How can I remove the file name from a complete file path.
The result should be the folder name.
Example:
A:\music\1966\The Who Sings My Generation\1. Out In The Street.mp3
to
A:\music\1966\The Who Sings My Generation\
Regex to remove file name from path
Re: Regex to remove file name from path
You can use regex to match a pattern, not remove the name from a path.
Where are you using this regex search?
Everything has the preprocessor to remove the name part:
[pathpart:"A:\music\1966\The Who Sings My Generation\1. Out In The Street.mp3"]
[path-path:]
Where are you using this regex search?
Everything has the preprocessor to remove the name part:
[pathpart:"A:\music\1966\The Who Sings My Generation\1. Out In The Street.mp3"]
[path-path:]
Re: Regex to remove file name from path
Found it using KI
Regex is
[^\\]*$
Usage is to use playlists as base for manipulating dirs in Total Commander.
Not my job, but some user asked for help.
I will remember path-part
Regex is
[^\\]*$
Usage is to use playlists as base for manipulating dirs in Total Commander.
Not my job, but some user asked for help.
I will remember path-part
Re: Regex to remove file name from path
Vim:
match anything up to the final \ (greedy)
-> .*\\
match everything else
-> .*
keep anything up to the final \
-> \1
(the "extra" \ are only there as ESC's)
As it is my player, when hit with a direname, attempts to play all the files within that directory.
So the playlist itself listed file & directory names, & the player on hitting the directory, would then also play the files within, duplicating the already listed file names in the playlist itself.
s/\(.*\\\).*/\1/
match anything up to the final \ (greedy)
-> .*\\
match everything else
-> .*
keep anything up to the final \
-> \1
(the "extra" \ are only there as ESC's)
(A long while back) I created a playlist & forgot to not include dirnames.playlists
As it is my player, when hit with a direname, attempts to play all the files within that directory.
So the playlist itself listed file & directory names, & the player on hitting the directory, would then also play the files within, duplicating the already listed file names in the playlist itself.