Page 1 of 1

Insert certain characters from containing folder

Posted: 2008-10-08 13:56:48
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?

Posted: 2008-10-08 14:33:34
by antp
After that you can use the character deletion or string replacement to remove the "- moves" part.

Posted: 2008-10-08 15:53:18
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

Posted: 2008-10-09 08:05:32
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]*) - (.*)#(.*)

Posted: 2008-10-09 09:15:29
by mickah
that worked a treat, thank you