Welcome Guest.   Make a donation to an author on the site October 24, 2014, 07:38:25 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2014! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: File Renaming: Renumbering by Calculation (e.g. even, odd)?  (Read 2221 times)
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« on: September 01, 2011, 06:53:51 AM »

Tried to figure out a simple way to renumber files of the form:

  000.ext, 001.ext, 002.ext, ...

as:

  000.ext, 002.ext, 004.ext, ...

or:

  001.ext, 003.ext, 005.ext, ...

What I ended up with was a multi-step process involving among other things, custom PascalScript via den4b's ReNamer.  For reference, the PascalScript part for even renumbering (plus prefix) was:

[copy or print]
var
  i: Integer;
  Number: String;
begin
  Number := Copy(FileName, 1, 3);
  i := StrToInt(Number);
  i := i * 2;
  FileName := 'a' + IntToStr(i) + WideCopy(FileName, 4, Length(FileName) - 3);
end.

This was followed by removing the prefix ('a') and appropriately zero-padding some of the filenames.

Does any one know of a simpler/easier way?  I also looked at Thunar's renaming feature and Metamorphose without coming up with anything useful.
Logged
Lashiec
Member
**
Posts: 2,374


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #1 on: September 01, 2011, 07:18:03 AM »

ReNamer can do it without using PascalScript:



You might want to strip the numbers first, though:



If you want to make it even more simpler, i.e. without using ReNamer or any other additional program (it's even easier with xplorer² mass rename), beats me.
« Last Edit: September 01, 2011, 07:24:37 AM by Lashiec » Logged
ewemoa
Honorary Member
**
Posts: 2,479



View Profile Give some DonationCredits to this forum member
« Reply #2 on: September 01, 2011, 07:24:27 AM »

Thanks!  The initial stripping seems to help quite a bit smiley
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.022s | Server load: 0.1 ]