Page 1 of 1

New Folder From Selected File BUT Ignore a Pattern ?

Posted: 14 Mar 2023 20:50
by GreetingsFromPoland
hi! is it possible to detect a part of a file name (and part of it ignored by pattern) and then use it to make a new folder ?

for example, if i have this file selected : Family Dinner S03E01.mkv
the script/command would create a new folder called "Family Dinner".

the "S03E01" could be anything but it would always follow the "S##E##" pattern.
another example would be the selected file "The Art of Vintage S01E04.mkv" would then have the folder "The Art of Vintage" created, etc.

i found an example on this forum to rename a file based on the folder name but got confused trying to make it work in reverse AND ignore a pattern in the file.

Re: New Folder From Selected File BUT Ignore a Pattern ?

Posted: 14 Mar 2023 21:03
by jupe
new(regexreplace(<curbase>, "\sS\d\dE\d\d.*"), "dir");

Re: New Folder From Selected File BUT Ignore a Pattern ?

Posted: 14 Mar 2023 21:40
by GreetingsFromPoland
oh my! that is AMAZING ! i wasn't any near close to that. thank you so much !