His mail describes the problem area and shows the script:
Perhaps this functionality could be built-in in Yawcam some dayHello Magnus,
today I found Yawcam when looking for a software for tracking a corner in my house basement where occasionally water gets in.
It is a great software with perfect functionality, thanks a lot that you made this freeware.
When playing with it and saving files to another server for harddisk purpose I realized that the sequence of the created pictures starts again with 0, 1, 2 when the files are moved. Therefore I found it a bit confusing to track the timely sequence when watching the pictures since the imageviewers sort image1, image11, image111, image2, image3 etc.
Therefore I wrote a small Per script that renames the files by putting Year-Month-Day-hour-minute before the filename. So the sorting is correct when viewing the images.
I thought it could be useful to share.
Requirements is the installation of the Perl modules from Activeperl(http://www.activestate.com/Products/ActivePerl/?_x=1).
The perl script does a dir *.jpg and combines the new filename out of the columns and finally renames the files.
Here a basic screen output and the script:
K:\>dir *.jpg
Volume in drive K has no label.
Volume Serial Number is 07D1-061A
Directory of K:\
06.06.2004 22:59 60.939 keller0.jpg
06.06.2004 23:00 61.125 keller1.jpg
06.06.2004 23:01 61.393 keller2.jpg
06.06.2004 23:02 61.120 keller3.jpg
06.06.2004 23:03 60.953 keller4.jpg
06.06.2004 23:04 61.187 keller5.jpg
06.06.2004 23:06 61.029 keller6.jpg
06.06.2004 23:07 61.157 keller7.jpg
06.06.2004 23:08 61.532 keller8.jpg
06.06.2004 23:09 61.228 keller9.jpg
10 File(s) 611.663 bytes
0 Dir(s) 749.387.776 bytes free
K:\>perl filerename.txt
rename keller0.jpg->2004-06-06-22-59-keller0.jpg
rename keller1.jpg->2004-06-06-23-00-keller1.jpg
rename keller2.jpg->2004-06-06-23-01-keller2.jpg
rename keller3.jpg->2004-06-06-23-02-keller3.jpg
rename keller4.jpg->2004-06-06-23-03-keller4.jpg
rename keller5.jpg->2004-06-06-23-04-keller5.jpg
rename keller6.jpg->2004-06-06-23-06-keller6.jpg
rename keller7.jpg->2004-06-06-23-07-keller7.jpg
rename keller8.jpg->2004-06-06-23-08-keller8.jpg
rename keller9.jpg->2004-06-06-23-09-keller9.jpg
K:\>type filerename.txt
system "dir *.jpg >xxx.txt";
open (WINDIR, "xxx.txt");
while ($line=<WINDIR>) {
$s=substr($line,0,1); #Erste Spalte numerisch, sonst keine Datei
if ($s =~ /[0-9]/) {
#print "$line";
$year=substr($line,6,4);
$month=substr($line,3,2);
$day=substr($line,0,2);
$hh=substr($line,12,2);
$mm=substr($line,15,2);
$orgfilename=substr($line,39,length($line)-40);
$newfilename="$year-$month-$day-$hh-$mm-$orgfilename";
print "rename $orgfilename->$newfilename\n";
rename ($orgfilename,$newfilename);
}
}
Best Regards
Thomas Schrenk

But until then use this script! It works like a charm!
Thanx Thomas!
/malun