New Folder From Selected File BUT Ignore a Pattern ?

Discuss and share scripts and script files...
Post Reply
GreetingsFromPoland
Posts: 222
Joined: 29 Sep 2022 14:20

New Folder From Selected File BUT Ignore a Pattern ?

Post 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.

jupe
Posts: 2788
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

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

Post by jupe »

new(regexreplace(<curbase>, "\sS\d\dE\d\d.*"), "dir");

GreetingsFromPoland
Posts: 222
Joined: 29 Sep 2022 14:20

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

Post by GreetingsFromPoland »

oh my! that is AMAZING ! i wasn't any near close to that. thank you so much !

Post Reply