#1 2007-10-01 06:00

MaJ
Member
Registered: 2007-10-01
Posts: 1

ReNamer - custom serialize with letters (a,b,c...)

Hi,

love your software, it's simple, powerful, and very handy.

Because of a server standard, I need to serialize using letters: a,b,c,d,.....,y,z,a1,b1,...etc.

Can that be done?

Thanks a lot,
Ma.

Offline

#2 2007-10-05 12:47

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

Re: ReNamer - custom serialize with letters (a,b,c...)

Yes, it can be done, using PascalScript rule.

If you have no experience in pascal/delphi programming, I can help you writing this script.

I will need to know variations of the serializing sequence... and where to insert it in the name.

For example, below is the code to append single letter from "abc...xyz" to each name, one-by-one.

var
  I: Integer;
  Letters: string;
  Initialized: Boolean;

begin
  if not Initialized then
  begin
    Letters := 'abcdefghijklmnopqrstuvwxyz';
    Initialized := True;
    I := 1;
  end;
  if I > Length(LETTERS) then I := 1;
  FileName := FileName + Letters[i];  
  I := I + 1;
end.

Offline

#3 2007-10-07 18:33

eagle
Member
Registered: 2007-10-07
Posts: 2

Re: ReNamer - custom serialize with letters (a,b,c...)

This will go in this sequence: a,b,c,...,x,y,z,a1,b1,c1,...,x1,y1,z1,a2,b2,c2,...,x2,y2,z2,... ... ... x999999,y999999,z999999,.....

var
  I, J: Integer;
  Letters: string;
  Initialized: Boolean;

begin
  if not Initialized then
  begin
    Letters := 'abcdefghijklmnopqrstuvwxyz';
    Initialized := True;
    I := 1;
    J := 0;
  end;
  if I > Length(LETTERS) then
  begin
    I := 1;
    J := J + 1;
  end;
  FileName := FileName + Letters[i];  
  if J > 0 then
    FileName := FileName + IntToStr(J);
  I := I + 1;
end.

Offline

#4 2007-10-07 21:30

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

Re: ReNamer - custom serialize with letters (a,b,c...)

Good job, eagle! smile

Here is a slightly modified version of your code, which will skip the extension:

var
  I, J: Integer;
  Letters, Pad: string;
  Initialized: Boolean;

begin
  if not Initialized then
  begin
    Initialized := True;
    Letters := 'abcdefghijklmnopqrstuvwxyz';
    I := 1; J := 0;
  end;
  if I > Length(Letters) then
  begin
    I := 1; J := J + 1;
  end;
  Pad := Letters[i];
  if J > 0 then 
    Pad := Pad + IntToStr(J);
  FileName := WideStripExtension(FileName) +
    Pad + WideExtractFileExt(FileName);  
  I := I + 1;
end.

Offline

#5 2017-06-02 16:52

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

Re: ReNamer - custom serialize with letters (a,b,c...)

ReNamer v6.7.0.2 Beta:
Added a selection of numeral systems to the Serialize rule: Decimal digits (0..9), English letters (a..z), Roman numerals (I,II,III,IV,...), Simplified Chinese, Custom alphabetic and Custom numeric.

Offline

Board footer

Powered by FluxBB