Reordering words in names - how?

This is a place for users to discuss Altap Salamander. Please feel free to ask, answer questions, and express your opinion. Please do not post problems, bug reports or feature requests here.
shurikas

Reordering words in names - how?

Post by shurikas »

Hi,
I need to reorder words in file names, but I can not understand how to do that. For example, I have file:
"Aillwee cave 2006.04.24 12-53-55.jpg"
I want to reorder words like this:
"2006.04.24 12-53-55 Aillwee cave.jpg"
How to do this with batch rename?
Thanks!
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5231
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

Show us more names you need to rename.

Is it always pattern "NAME1 NAME2 DATE TIME.jpg"
that you need rename to "DATE TIME NAME1 NAME2.jpg"?

With NAME1, NAME2, DATE, and TIME I mean stings that doesn't contain space character. So for example "Aillwee 2006.04.24 12-53-55.jpg" will not match this pattern because there isn't NAME2. Also "The Aillwee cave 2006.04.24 12-53-55.jpg" will not match it because there are three names: NAME1, NAME2, and NAME3.
Last edited by Jan Rysavy on 19 Feb 2008, 11:50, edited 2 times in total.
shurikas

Post by shurikas »

Unfortunately no. It can be one word, or even 5 words like Name1 ... Name5. But the date/time format is fixed.
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5231
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

Is DATE and TIME always in format "yyyy.mm.dd hh-mm-ss"?
shurikas

Post by shurikas »

Yes, date and time always in format "yyyy.mm.dd hh-mm-ss".
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5231
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

Try this (my lame approach, but should be clear).
Search for: (.*) (\d\d\d\d.\d\d.\d\d) (\d\d-\d\d-\d\d)
Replace with: $2 $3 $1
[X] Regular expression

Note: the () capture subexpression for further use with $1, $2, etc.
The \d stands for digit character.
Attachments
Batch Renamer
Batch Renamer
batchrenamer.gif (26.26 KiB) Viewed 8792 times
shurikas

Post by shurikas »

Thanks!
It worked!
Post Reply