* John Richard Smith <[EMAIL PROTECTED]> [020926 05:05]:
> Very Many thanks Jan,
 
You're welcome.  Hopefully others will benefit too.

> I have a feeling this programme is going to be very useful to me. I cannot
> think why it's not in the distro on the 3rd disc.

Possibly.

> Sooner ot later I am going to have so many .jpg files alone, that they will
> need their nomenclature redefined in order to store them, because each
> batch of camera generated image files begins at the same set on nomenclature
> which isall very well but jolly inconvenient when you want to combine for
> long term storage purposes.

You might see if your camera has another option.  Mine (an Olympus
3030z) includes the date in the filename, and then a serial number
which can either begin fresh after each SmartMedia disk is erased or
installed fresh, or it can continue the serial number until it reaches
9999 and restart at 0000.

> So it looks as though I can use chcase to  change the file names
> from what ever they be when downloaded into date order, for instance ?
 
Well, with some difficulty.  Ideally, it would extract the date
information from the image file.  I have a Perl script that I wrote
that does this, but it's designed for my Olympus and probably wouldn't
work with another brand or even model.  I had to modify it when I
moved up from Olympus 320z to 3030z.

If you just wanted the timestamp from the file or the time you ran
chcase to be reflected in the
filename, it would be easier to do, but what format?  For example, you
can include `date` in your Perl script, but it gives a rather unwieldy
string, like:

Thu Sep 26 05:56:18 CST 2002

and with a fast computer they would likely all get the same date,
including the second  ;-)

If you use `date +%y%m%d` you would get:

020926

which might be useful combined with the serial number.  Maybe too many
numbers, though.  ;-)

> my experimental folder:-
> root/Desktop/mont
> root]# cd /root/Desktop/mont
> mont]# ls
> DSCI0001.JPG  DSCI0004.JPG  DSCI0007.JPG  DSCI0010.JPG  DSCI0013.JPG
> DSCI0002.JPG  DSCI0005.JPG  DSCI0008.JPG  DSCI0011.JPG  DSCI0014.JPG
> DSCI0003.JPG  DSCI0006.JPG  DSCI0009.JPG  DSCI0012.JPG
> 
> chcase -x 'tr/DSC1*/dd/mm/yyyy'*.jpg
> Now I don't ecpect that to work because for
> one thing it will create a lot of files that may
> possibly end up with the same name, or would it,
> presumeably it would addopt the numerical progression
> as well.

No, that won't work at all.  To begin with, the Perl tr/pattern1/pattern2/
structure only makes a literal translation of characters, replacing
any character in pattern1 with its corresponding character in
pattern2.  Not what you want at all.  And of course, you cannot use
'/' to separate day, month, and year in a filename because the '/' is
used to separate directories and files in the path.

> What would be your thought here Jan, or maybe you have a better
> suggestion.

Why not just create a directory for each batch of photos you download,
and put them into that.  One directory would get unmanageable anyway.
Then you can use chcase to change the names to something more
manageable, but keep the serial numbers to differentiate files.  For
example, maybe make a directory called 0210 for 2002 October, and in
it you put photos from a birthday party:

chcase *.JPG
chcase -x 's/dsci/bday/' *.jpg

Hope this helps.

-- 
Jan Wilson, SysAdmin     _/*];          [EMAIL PROTECTED]
Corozal Junior College   |  |:'  corozal.com corozal.bz
Corozal Town, Belize     |  /'  chetumal.com & linux.bz
Reg. Linux user #151611  |_/   Network, PHP, Perl, HTML


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to