Page 1 of 1

Switch portions of filename strings

PostPosted: Sun Dec 07, 2008 9:17 pm
by lutzipoo
Hello,

at first many thanks for this great utility which I am to explore from now! Looks very promising!

Question:

I have to rename quite a number of mp3-files by taking a part of the front of the file name with varying length, and inserting this partial string prior to the filename separator . (dot).

Example:
20071013_002_Come Away With Me_Norah Jones.mp3
to become
Come Away With Me_Norah Jones_20071013_002_.mp3
or
Come Away With Me_Norah Jones_20071013_002.mp3

Is this possible? Any help is appreciated. :roll:

Have a nice day

Lutzipoo

Re: Switch portions of filename strings

PostPosted: Mon Dec 08, 2008 10:31 am
by jimwillsher
Hi,

You can easily do this using Regular Expressions, check out the RegExp part of this board for loads of similar posts and solutions.



Jim

Re: Switch portions of filename strings

PostPosted: Mon Dec 08, 2008 5:20 pm
by GMA
Hi, Lutzipoo:
Try with this expression:

RegEx (1):
MATCH: ([0-9]*)(.)([0-9]*)_(.*)
REPLACE: \4_\1\2\3

Hope it helps. Happy holydays to the forum,

Gabriel.

Re: Switch portions of filename strings

PostPosted: Mon Dec 08, 2008 7:51 pm
by lutzipoo
Hello Gabriel,

IT WORKED

you just caught me before getting ´insane´. Thanks a lot, I was struggeling with piles of paper on the subject PERL. Now I have a bit more time to relax and study.

Thanks Gabriel

Lutz :mrgreen: :mrgreen: