#1 2010-10-11 09:17

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

Serialize bulk of 3 files, then reset counter

atthershabbir wrote:

Hi guys..

M new to X i did rnd but wouldnt get the way rename as i want.
I have placed an example what i really want to do.
For example I have a folder with 9 files as under :
1) DSN001.jpg want to rename as MW001-01.jpg
2) DSN002.jpg want to rename as MW001-02.jpg
3) DSN003.jpg want to rename as MW001-03.jpg

4) DSN004.jpg want to rename as MW002-01.jpg
5) DSN005.jpg want to rename as MW002-02.jpg
6) DSN006.jpg want to rename as MW002-03.jpg

7) DSN007.jpg want to rename as MW003-01.jpg
8) DSN008.jpg want to rename as MW003-02.jpg
9) DSN009.jpg want to rename as MW003-03.jpg

As you see i want to rename in sets of 3 files.
Please help me in this as i need this to badly as i have folders with more then 1000 pics regularly as i m into product photography and i need to rename them on regular basis.


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

#2 2010-10-11 09:22

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

Re: Serialize bulk of 3 files, then reset counter

We can do this in three steps/rules:

1) Delete the whole file name first; Delete: Delete from Position 1 until the End (skip extension)
2) Use an PascalScript to serialize 3 files with the same number (MW001); PascalScript:
3) Serialize every three files from 01 to 03 (-01); Serialize: Serialize Incremental from 1 step 1 (reset index every 3 files) and pad to length 2 as suffix (before extension)


For 1 +3 See the WIKI for more about using Rules:
=> http://www.den4b.com/wiki/ReNamer:Rules


For 2.) here is the script:

var
 Serial, FileCount: integer;
 SerialStr: string;

begin
//initialize:
  if Serial < 1 Then Serial := 1;
  if FileCount < 1 then FileCount := 1;

//convert number to string and pad with zeros:
  SerialStr := IntToStr(Serial);
  while Length(SerialStr) < 3 do
      SerialStr := '0'+SerialStr;

//build new file name,
  //fixed string 'MW' plus Serial plus dash plus ext:
  FileName := 'MW' + SerialStr + '-' + WideExtractFileExt(FileName);

//increase file count by one:
  FileCount := FileCount + 1;
  //reset file count after every third file:
  if FileCount > 3 then
    begin
      FileCount := 0
        //but increase Serial by one for the next three files:
       Serial := Serial + 1
    end;
end.

See the WIKI for more about using Rules:
=> http://www.den4b.com/wiki/ReNamer:Rules

Last edited by Stefan (2010-10-11 09:25)


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 2010-10-11 13:02

atthershabbir
Member
Registered: 2010-10-11
Posts: 4

Re: Serialize bulk of 3 files, then reset counter

Thanks for your reply man... it was cool solution i got it working but stuck on 1 step.

---------------------------------------
We can do this in three steps/rules:
1) Delete the whole file name first; Delete: Delete from Position 1 until the End (skip extension)
2) Use an PascalScript to serialize 3 files with the same number (MW001); PascalScript:
3) Serialize every three files from 01 to 03 (-01); Serialize: Serialize Incremental from 1 step 1 (reset index every 3 files) and pad to length 2 as suffix (before extension)
---------------------------------------

I completed Step 1 & 2 successfully but stuck on 3rd step where in you said "reset index every 3 files" how do i do that? as there is no option for it.

I am attaching the screen shot below :
Renamerscreenshot.JPG

Offline

#4 2010-10-11 16:14

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

Re: Serialize bulk of 3 files, then reset counter

atthershabbir wrote:

Thanks for your reply man... it was cool solution i got it working but stuck on 1 step.

but stuck on 3rd step

Oh, i am sorry, i do always this mistake :-(

The solution is: You have to use the latest beta because this feature was added recently only
>> http://www.den4b.com/projects/ReNamer/ReNamerBeta.zip


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

#5 2010-10-12 06:01

atthershabbir
Member
Registered: 2010-10-11
Posts: 4

Re: Serialize bulk of 3 files, then reset counter

Thanks for your reply man i got the Beta version and tried it out but there is little issue with the software.
If you see the screenshot the first set
MW001-01
MW001-02
MW001-03
was successfully but after that there is 04 serial coming sad
MW002-01
MW002-02
MW002-03
MW002-04

Check the screenshot below :
renamecapture1.JPG

Offline

#6 2010-10-13 16:26

atthershabbir
Member
Registered: 2010-10-11
Posts: 4

Re: Serialize bulk of 3 files, then reset counter

still no reply buddy....

Offline

#7 2010-10-14 13:18

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Serialize bulk of 3 files, then reset counter

Looks like a bug.

I would post the question on the Bugs section. (Probably Dennis is busy and has not entered this part of the forum.)

Meanwhile, if you are in a rush, you could use this:

var I: Integer;
begin
  If I>=3 then I:=1 else I:=I+1;
  FileName := WideExtractBaseName(FileName) + '0' + IntToStr(I) + WideExtractFileExt(FileName);
end.

If this software has helped you, consider getting your pro version. :)

Offline

#8 2010-10-15 09:49

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

Re: Serialize bulk of 3 files, then reset counter

There was a little problem with the reset counter, it was reset to a 0 value instead of 1.

It is fixed now: ReNamerBeta.zip

Offline

#9 2010-10-16 05:00

atthershabbir
Member
Registered: 2010-10-11
Posts: 4

Re: Serialize bulk of 3 files, then reset counter

thanks guys... i got it workin well now wink

Offline

Board footer

Powered by FluxBB