[Sussex] Rename a list of files

Geoffrey J. Teale gteale at cmedresearch.com
Wed May 11 13:08:26 UTC 2005


"Angelo Servini" <Angelo.Servini at claybrook.co.uk> writes:

> Hi Geoff
>
> Thanks for your reply.

Not a problem.

> I suppose Id better define the problem properly.  I am a bit of a
> Photo buff and use a Digital Camera to capture images.  As you know,
> once a list of images has been captured, it is usual to rip out the
> duff images (or images you simply do not want).  This leaves a list
> with missing numbers.

...k...

> I also want to merge lists from two separate smartmedia cards, where
> the images always start with the same numbers.  These I would like
> to be merged into one list in one subdirectory, the first lot from
> img0001.jpg to img000n.jpg and the second lot starting at
> img000n+1.jpg, where n is the number of images in the first lot.
>
> Most of the time, Im not really interested in naming each particular image, just that their in one particular folder named after the date-venue where the photo's were captured.  So the solution might actually be:
>
> 1.  Specify a mask to name the files.  Ie. img####.jpg  where #### represents the number to replace with a sequential integer.
>
> 2.  Specify a list of subdirectories containing images.
>
> 3.  Specify a target directory to contain the merged list of images.
>
> I can then burn that to a CD.
>
>
> What do you think?  What Im looking for are maybe examples, or even as you said, "what application / development solution do I use?"

Right, well if you're going to be writing scripts like this regularly
(and the need may well occur) I'd start by learning a scripting
language.

I wouldn't recommend Bash unless you particularly want to improve your
bash skills.  

Python is probably the easiest to learn, Perl perhaps the quickest way
to right something and Ruby probably the best compromise between the
two (and definitely the most elegant).  PHP is also an option, but I
have very little experience of it so I cannot really comment.

Don't have the time to do any examples right now, but why not pick a
language, take a look your self and then come back with questions?

-- 
Geoff Teale
CMed Technology            -   gteale at cmedresearch.com
Free Software Foundation   -   tealeg at member.fsf.org




More information about the Sussex mailing list