Insert certain characters from containing folder

If you need help on how to use the program
Post Reply
mickah
Posts: 3
Joined: 2008-10-08 13:49:23

Insert certain characters from containing folder

Post by mickah »

demo1333 - movies/mymovie1.avi

I want to insert the first 8 characters of the containing folder:
demo1333-mymovie1.avi

I'm doing string insert at the moment:
%folder1%-

and getting:
demo1333 - movies-mymovie1.avi

Any ideas?
antp
Site Admin
Posts: 9665
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

After that you can use the character deletion or string replacement to remove the "- moves" part.
mickah
Posts: 3
Joined: 2008-10-08 13:49:23

Post by mickah »

the start of the folder name is always demo1333 or whatever number of 4 digit size, but what comes afterwards varies in both size and content.

So:

demo1333 - movies blah/moviename.avi
demo1259 - movies asd gah 11 blah/moviename2.avi
demo1862 - mov/moviename3.avi

are all possibilites.

All I want are the 1st 8 digits of the folder name.

Thanks
antp
Site Admin
Posts: 9665
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

you could use regular expressions to remove the part once the folder name added to file name :

expression = demo([0-9]*) - (.*)-(.*)
new name = demo$1-$3

if the original names already contain dashes, you may have to use some other character else it will keep only end of the name.

e.g.
insert: %folder1%#
and use expression: expression = demo([0-9]*) - (.*)#(.*)
mickah
Posts: 3
Joined: 2008-10-08 13:49:23

Post by mickah »

that worked a treat, thank you
Post Reply