[brlug-general] Script help
B. Estrade
estrabd at gmail.com
Wed May 30 09:05:51 CDT 2007
On 5/30/07, Tim Fournet <tfournet at tfour.net> wrote:
> Some command-line utilities that may help you:
> rename - for renaming the files if you need to. It's more flexible than
> using the 'mv' command since it uses patterns within the filename
> identify - part of the ImageMagick package - it will display information
> about the images, as well as the data portions as you were asking about
I find the following one liner very helpful for renaming files:
# find . | perl -ne'chomp; next unless -e; $oldname = $_; s/aaa/bbb/;
next if -e; rename $oldname, $_'
Not so obviously, this replaces 'aaa' with 'bbb'.
Cheers,
>
> Joe Fruchey wrote:
> > I've been using F-Spot for photo organization lately. I like how it
> > automatically copies files into a date-based directory structure,
> > unlike Picasa which makes you sort it out yourself.
> >
> > I inadvertently double-imported some photos. F-Spot has named those
> > photos XXXX-1.JPG
> >
> > In all subdirectories of my ~/Photos directory, I would like to MOVE
> > all *-1.[JPG,jpg] to ~/Photos/dupes. That's the easy part. Then, I
> > want to COPY the associated non-1 file to dupes as well, that way I
> > can manually check to see if there are any that are not actually
> > dupes. Also, if XXX-1 exists, but XXX does not, I want to leave XXX
> > alone.
> >
> > ... Is there an easy way to traverse subdirectories? I saw that mv
> > doesn't have an available -R option, but cp and rm do... but that only
> > seems to work if you're copying or deleting an entire directory.
> >
> > Anyhow, the second thing I want to do is search for files by number.
> > For instance, my camera produces images named P1010001.JPG. I want a
> > script that will check my ~/Photos directory and, for instance, if it
> > finds P1040586.JPG, then P1040622.JPG, with no intermediates, notify
> > me so I can be aware that I'm missing a chunk of photos. If it can
> > display EXIF data, that'd be great too, and maybe even a thumbnail.
> >
> > I'm not asking anyone to write these scripts for me, but rather to
> > point me in the direction of some resources that may help me. Can this
> > be done with Python? I've been wanting to learn Python anyway...
> >
> > _______________________________________________
> > General mailing list
> > General at brlug.net
> > http://mail.brlug.net/mailman/listinfo/general_brlug.net
> >
>
>
> _______________________________________________
> General mailing list
> General at brlug.net
> http://mail.brlug.net/mailman/listinfo/general_brlug.net
>
--
225.578.1920
AIM: bz743
http://www.loni.org/
estrabd at lsu.edu
estrabd at gmail.com
More information about the General
mailing list