#1 2009-01-07 02:49

Sunshy
Member
Registered: 2008-11-21
Posts: 7

How to move serial numbers from back of file name to front?

I have many files with a sequential number at the end of the file like this:

A File_01.mp3
B File_03.mp3
C File_02.mp3
D File_04.mp3

Notice that the files are listed alphabetically but not sequentially because the numbers are at the end of the file. What I'd like to end up with is the following:


01. A File.mp3
02. C File.mp3
03. B File.mp3
04. D File.mp3

The problem lies in this: when I drag over a large number of files, they are not in sequence so simple renaming will serialize them in the incorrect order. I have to manually drop them in one by one, being careful that I drop them in the correct order. Is there an intelligent way to accomplish this? Perhaps finding "_XX" at the end of the file and moving it to the beginning of the file?

Offline

#2 2009-01-07 13:04

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: How to move serial numbers from back of file name to front?

Hi Sunshy,

you can achieve this with ReNamer at easy by using Regular Expressions:

First think about what you want to get:
1.) Find ALL till an underscore ... and save this as backreference (1)
2.) Find one or more digits behind the underscore ... and save this as backreference (2)
3.) rename with content of backreference (2) first, followed by an DOT and an SPACE, followed by content of backreference (1)

so
- test with some test files only
- add an RULE RegEx
- Expression: (.*)_(\d+)
- Replace: $2. $1
- PREVIEW
note that this regex may fit only to the examples you have provided


Hint:
one could use this RegEx above to sort the files only without renaming them now.
- don't rename, just do an preview
- then click on the "New Name"-column header to sort this column and the "Name" column too,
- deactivate RegEx rule
- add rule to serialize
- preview


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2009-01-07 22:22

Sunshy
Member
Registered: 2008-11-21
Posts: 7

Re: How to move serial numbers from back of file name to front?

Thanks so much Stefan. Your instructions worked perfectly. I probably need to study the manual more carefully to understand the regex function more. I'm happy to support renamer with a small donation. What a time saver (you and the program)!

Offline

Board footer

Powered by FluxBB