#1 2007-03-17 10:39

MyComputer
Member
Registered: 2007-03-17
Posts: 1

Move pattern to start (prefix)

Hi
I hope you can help, I'm trying to do the following, using these file examples:

DSC_0001-1.jpg
DSC_0001-10.jpg
DSC_0001-2.jpg
DSC_0001-21.jpg
DSC_0002-1.jpg
DSC_0002-10.jpg
DSC_0002-2.jpg
DSC_0002-21.jpg

I want to move "-1", "-10" etc to the start and swap the "-" and the "n" so I end up like this:

1-DSC_0001.jpg
10-DSC_0001.jpg
2-DSC_0001.jpg
21-DSC_0001.jpg
1-DSC_0002.jpg
10-DSC_0002.jpg
2-DSC_0002.jpg
21-DSC_0002.jpg

Is this possible.

Many thanks for a very useful program.

Offline

#2 2007-03-18 12:53

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,374

Re: Move pattern to start (prefix)

Yes, it is possible, and a similar problem has been discussed in this topic: Swapping words within a file name.

You need to use Regular Expressions, and here are the parameters:
Expression: (.*)-(.*)
Replace: $2-$1
Skip Extension: Yes

This will swap to parts separated with the dash. Good Luck! smile

Offline

Board footer

Powered by FluxBB