Renaming Even numbered files

Advanced Renamer forum
#1 : 02/04-14 12:57
Imran Malik
Imran Malik
Posts: 3
hi, i need help. i need to to replace a part of every even numbered file name.
i.e.,
i want to change followings
C-20140402-Fron00001
C-20140402-Fron00002 <--
C-20140402-Fron00003
C-20140402-Fron00004 <--
C-20140402-Fron00005
C-20140402-Fron00006 <--
C-20140402-Fron00007
C-20140402-Fron00008 <--

to

C-20140402-Fron00001
C-20140402-Back00002
C-20140402-Fron00003
C-20140402-Back00004
C-20140402-Fron00005
C-20140402-Back00006
C-20140402-Fron00007
C-20140402-Back00008

i am not a javascript expert so can anybody help me, please?


02/04-14 12:57 - edited 03/04-14 09:40
#2 : 03/04-14 08:57
Stefan
Stefan
Posts: 274
Reply to #1:

- Select all files
- add Replace Method (http://www.advancedrenamer.com/user_guide/metho d_replace)
- search for "Fron"
- replace by "Back"


.


03/04-14 08:57
#3 : 03/04-14 08:59
Imran Malik
Imran Malik
Posts: 3
Reply to #2:
Buddy i want only even numbered files to be changed not all files. i cannot select or deselect manually since there are 1000s of files. manually selecting can cause a human error as well.
i need a script


03/04-14 08:59
#4 : 03/04-14 13:05
Stefan
Stefan
Posts: 274
Reply to #3:

That's now modified to a much more clear question now, buddy.


That enables me to provide a better solution.

FROM:
Fron1.ext
Fron2.ext
Fron3.ext
Fron4.ext
Fron5.ext
Fron6.ext

TO:
Fron1.ext
Back2.ext <
Fron3.ext
Back4.ext <
Fron5.ext
Back6.ext <

Rule:
Work on every second file from the list.
(To be clear, that means: not taking the real odd or even digits
of the file name into account. That would be another script)



Use Method Script with a JavaScript like this:

//-------------

newname = item.name;

if (index % 2 == 1)
newname = newname.replace(/Fron/g, 'Back');

return newname;

//-------------




Tip for others:
To work on every first file, use
"if (index % 2 == 0)"


.


03/04-14 13:05 - edited 03/04-14 13:10
#5 : 04/04-14 10:03
Imran Malik
Imran Malik
Posts: 3
Reply to #4:
Thanks a lot, it really solved my problems. Thanks again


04/04-14 10:03