adding leading zeros to a filename

From: rupert (usenet_at_rupespad.com)
Date: 01/28/05


Date: Fri, 28 Jan 2005 19:31:44 GMT

I've tried unsuccessfully to find the answer to this, so am hoping
someone here can help...

I've got a directory of photos called:

1.jpg
2.jpg

....

10.jpg
11.jpg

...

100.jpg
101.jpg

...

and I can't for the life of me work out how to write a script to add
leading zeros to the filenames so they are in the form

001.jpg
002.jpg

....

010.jpg
011.jpg

...

100.jpg
101.jpg

...

any help would be gratefully received

Ta most muchly in advance

Rupert :)



Relevant Pages

  • Re: Simple image gallery?
    ... photos somewhere on the future "to do" list? ... gallery with it, then by all means do so, but I feel that I have ... anything besides uploading the script and the images. ...
    (comp.lang.php)
  • Re: web pages and iPhoto
    ... the full size pictures folder, re-export the photos as files so they keep ... their filenames, and manually edit the web pages to point to the real ... If I knew that I would resize them, but I don't print my photos very often. ... I wanted my friends to do the choosing but perhaps I had better ...
    (comp.sys.mac.apps)
  • Re: photo gallery upload script
    ... I would like to create php code for uploading photos into the server. ... I would like to upload unlimited number of photos into the ftp server after once clicking on "Browse" button. ... I would like to create also script which would send me emails to the group of people who have accounts to this page, but mail script is easy to implement. ...
    (comp.lang.php)
  • Re: Basic Permissions
    ... >Now when I connect the camera and turn it on it appears as a device and I ... >I would like to setup the security so that they can copy photos from the ... >As they login as a user I would like to restrict the permissions for the ... The shell script provided below copies everything from /media/Camera ...
    (comp.os.linux.security)
  • Re: Tool to generate static pages with Photos
    ... Tool to generate static pages with Photos ... With this script you an place it inside the Nautilus scripts folder ( ... To customize your HTML pages you simply create a .pixdir2htmlrc file ...
    (Ubuntu)