#1 2006-12-08 12:15

drunk
Member
Registered: 2006-12-08
Posts: 3

Swapping words within a file name?

Howdy from Down Under! Great software! big_smile

I'm in the same boat as this guy http://www.den4b.com/forum/viewtopic.php?id=6  well the first two (and last) sentences anyway wink

I often need to rename files by swapping groups of words, either side of a seperator.

Is there any easy way to do this with ReNamer? Like the Swap/Add function in 1-4a Rename?

Visual explanation:
1-4a%20EG4.jpg

Last edited by drunk (2006-12-08 12:31)

Offline

#2 2006-12-08 13:12

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

Re: Swapping words within a file name?

Yep, there is an easy way: RegEx! smile

Expression: (.*) - (.*)
Replace: $2 - $1

- will switch two blocks around separated by the " - ", e.g.: if input string is "John Smith - Some Song", then output will be "Some Song - John Smith".

Note: if you use any special symbols like "." (dot) as a separator, it will have to be escaped using slash, like this "\.". For more info look at he help in RegEx, or google for Regular Expressions.

Offline

#3 2006-12-08 13:48

drunk
Member
Registered: 2006-12-08
Posts: 3

Re: Swapping words within a file name?

Well that was just too easy wink And too bloody quick on the support! yikes

Yeah I suspected the answer may lie within RegEx and did a bit of snooping around, but I'm just not too familiar with the old regular expressions.
Best I get acquainted I guess.

That works perfectly... thanks heaps for your help!

Offline

Board footer

Powered by FluxBB