You are not logged in.
Hello everyone,
I'm looking for a way to solve my photo galleries problem:
I have many photo gallery folders, with the following files:
Photo001.jpg
Photo002.jpg
Photo004.jpg
Photo005.jpg
Photo007.jpg
Photo008.jpg
Photo009.jpg
Photo010.jpg
PicA1.jpg
PicB2.jpg
As you can see in the list above, the problem is, some files have different names, like "PicA1.jpg" and "PicB2.jpg" and the 001-010 are missing 2 numbers.
Is there a way to replace these filenames with the missing ones?
PicA1.jpg to Photo003.jpg
PicB2.jpg to Photo006.jpg
I hope it can be done with ReNamer (i already use it a lot) but if there is no way to solve my problem with ReNamer, please help me find something else, maybe a .bat/.cmd Batch file? or is there any other tool?
Thanks in advance!
~Jack
Offline
Hi Jack, welcome.
I think only you self can know that "PicA1.jpg" is related to "Photo003.jpg".
No program can guess that for you.
Or is there a rule that "PicA1.jpg" is the first missed number from the list? B2 the second.
Then you can generate a list of missed numbers from the Photo files and with that rename the A1 and B2 files.
Or do i miss something? I don't see it.
.
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
Yes, its related by 'sort by filename'
PicA1.jpg is Photo003.jpg
And indeed, i need to make a list of filenames missing from Photo001>Photo010, and name the first 'sorted by name' non-"Photo000" filename to that missing filename.
I have over 100 photo galleries, which used a wrong auto rename function (for an unknown reason) a long time ago.
if i have 6 files:
PicA1.jpg, PicB2.jpg, PicB74.jpg, PicB81.jpg, PicC0.jpg and PicC921.jpg
PicA1.jpg must be renamed to first missing filename in the Photo000 filelist
PicB2.jpg must be renamed to second missing filename in the Photo000 filelist
PicB74.jpg must be renamed to third missing filename in the Photo000 filelist
PicB81.jpg must be renamed to fourth missing filename in the Photo000 filelist
PicC0.jpg must be renamed to sixth missing filename in the Photo000 filelist
PicC921.jpg must be renamed to seventh missing filename in the Photo000 filelist
I hope it can be done, someway, because there is a logic, but i cant find something to make all this go automatically, i already done 18 galleries, its driving me insane, because i have to find which files from the Photo000 filelist are missing as well! all manually...
Even a tool, that generate a .log/.txt file containing the names of the missing Photo000 files, it would already reduce the amount of time by 60% i have to spend on finding them.
Oh, i hope there is a solution... Really want the galleries to be clean.
Thanks for the replies!!!
~Jack
Offline
My first idea is, you do that association "PicA1" <> "FirstMissedSerial" yourself by
- selecting all the PicA1 files (i hope you have them already in the right order)
- add rule UserInput
- past the list of missed serial file names in.
see our wiki >>> http://www.den4b.com/wiki/ReNamer:Rules:UserInput
To get "the list of missed serial file names" we have to do still a little work.
I think i have written already an code to do that, but that was an other language i guess.
I have tried to do this with an PascalScript rule, but didn't have the right idea right now.
The script below e.g. finds only one single missed serial in a row.
BTW; you have backups, right?
Note:
- to let it work add at least one file from the wanted folder to the file list. So the script knows which folder to scan.
- you have to use the latest beta (27. Jan.) from the download page due to "GetCurrentFileIndex" command (that's brand new)
//Find missed serial numbers.
nonsense deleted ;-)
Result:
---------------------------
ReNamer
---------------------------
Photo003
Photo006
---------------------------
OK
---------------------------
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
Thanks a LOT for your reply!
Ill try to play with right away, and yes, everything is backup'd
brb
Offline
OK, im getting there now... THANKS!!!
I editted the script a little, had to replace the "Photo" because every gallery have different names:
2010August_001
2010August_002
2010August_003
etc.
but also:
11Jun-01
11Jun-02
11Jun-03
etc.
and:
Jacky2011_0001
Jacky2011_0002
Jacky2011_0003
etc.
if i manually editted the "Photo" in your script, it worked great!
Can you make it so i get a popup asking for string, like:
"name##" for 11Jun-01,11Jun-02,11Jun-03,etc.
"2010August_###" for 2010August_001,2010August_002,2010August_003
"Jacky2011_####" for Jacky2011_0001,Jacky2011_0002,Jacky2011_0003,etc.
for example?
HUGE THANKS!!!
EDIT: nvm, it didnt work - it gives me a list of many filenames, jumping +1 very file... example:
2010August_001.jpg
2010August_003.jpg
2010August_005.jpg
2010August_007.jpg
2010August_009.jpg
2010August_011.jpg
2010August_013.jpg
etc.
But they are there!
Help?
Last edited by Jack28 (2013-01-28 22:15)
Offline
I think i got a better idea:
//Find missed serial numbers.
//Note:
//- to let it work add at least one file from the wanted folder to the file list. So the script knows which folder to scan.
//- you have to use the latest beta (27. Jan.) from the download page due to "GetCurrentFileIndex" command (that's brand new)
var
Parent, Part1, Digits, Part2, Ext, Missed :WideString;
Loop, Last, Pad :integer;
begin
if(GetCurrentFileIndex=1)then
begin
Parent:= WideExtractFileDir(FilePath);
Part1 := 'Photo'; //file name part before the digits, like 'Vacation_'
Pad := 3; // amount of digits in serial number, like '001' are three (3)
Part2 := ''; //file name part after the digits, like '_Paris2013'
Ext := '.jpg'; //extension, like '.jpg'
Last := 30; // check from 1 till Last possible number
for Loop:= 1 to Last do
begin
Digits := IntToStr(Loop);
while (length(Digits) < Pad) do Digits := '0'+Digits;
if (WideFileExists(Parent + '\' + Part1 + Digits + Part2 + Ext)=false) then
Missed := Missed + Part1 + Digits + Part2 + #13#10;
end;
ShowMessage(Missed); // MessageBox
SetClipboardText(Missed); //Copy to clipboard
end;
end.
HTH?
Screen shots (EDIT 2017: sorry, the pictures are not visible any longer)
Proof of concept:
Part1 := 'Photo'; //file name part before the digits, like 'Vacation_'
Pad := 3; // amount of digits in serial number, like '001' are three (3)
Part2 := ''; //file name part after the digits, like '_Paris2013'
Ext := '.jpg'; //extension, like '.jpg'
Last := 30; // check from 1 till Last possible number
PascalScript: User Settings for this case:
Part1 := 'Photo'; //file name part before the digits, like 'Vacation_'
Pad := 3; // amount of digits in serial number, like '001' are three (3)
Part2 := ''; //file name part after the digits, like '_Paris2013'
Ext := '.jpg'; //extension, like '.jpg'
Last := 10; // check from 1 till Last possible number
* Add miss-spelled files PicA1, PicB2, ... ( KEEP CARE AT THE ORDER, windowsTM change often the order, see according thread)
* and click Preview.
Missed file names (not the visible, but according to the settings) are copied to clipboard:
Use this copied text with UserInput rule.
* Disable PascalScript
* Add UserInput rule
* Paste missed names
* Preview
PicA1 would be renamed to first missed file
PicB2 to second,....
.
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
I did it something similar once, and what I did was more or less like this...
var
Prefix, Suffix, Digits, Candidate: WideString;
I, Pad: Integer;
begin
Prefix := 'Photo'; //file name part before the digits, like 'Vacation_'
Suffix := ''; //file name part after the digits, like '_Paris2013'
Pad := 3; // amount of digits in serial number, like '001' are three (3)
Prefix := WideExtractFileDir(FilePath) + '\' + Prefix;
Suffix := Suffix + WideExtractFileExt(FilePath);
repeat
I := I + 1;
Digits := IntToStr(I);
while (length(Digits) < Pad) do Digits := '0' + Digits;
Candidate := Prefix + Digits + Suffix;
until (not WideFileExists(Candidate));
FileName := Candidate;
// FileName := WideReplaceText(FileName, WideExtractFileDir(FilePath)+'\', '');
end.
Last edited by SafetyCar (2013-01-29 11:34)
If this software has helped you, consider getting your pro version. :)
Offline
Thanks a LOT guys! Really! This already helps me a LOT!
SafetyCar's solution is the quickest, i can easily see the missing files and point the right order of the "strange" filenames, but there is one more problem: the default filename,
Is there a way i can get a popup with it, before the preview, where i can fill in the default name aka "Photo"?
Offline
I now have this, but it repeats the inbox for every file, is it possible to get it remembered for the next files to progress?
var
Prefix, Suffix, Digits, Candidate: WideString;
I, Pad: Integer;
begin
Prefix := InputBox('Prefix', 'Please type in the Prefix', 'Vacation_');
//Prefix := 'Photo'; //file name part before the digits, like 'Vacation_'
Suffix := ''; //file name part after the digits, like '_Paris2013'
Pad := 3; // amount of digits in serial number, like '001' are three (3)
Prefix := WideExtractFileDir(FilePath) + '\' + Prefix;
Suffix := Suffix + WideExtractFileExt(FilePath);
repeat
I := I + 1;
Digits := IntToStr(I);
while (length(Digits) < Pad) do Digits := '0' + Digits;
Candidate := Prefix + Digits + Suffix;
until (not WideFileExists(Candidate));
FileName := Candidate;
// FileName := WideReplaceText(FileName, WideExtractFileDir(FilePath)+'\', '');
end.
Offline