Hi Simon,

> Is there an easy way to compare the filenames and remove the
> JPGs of those duplicated files.

If you have OSX, you could always try the following in your unix shell:

  find -type f | egrep -i '(\.jpg|\.tiff)$' |
  sed 's/\.jpg$//i ; s/\.tiff$//i' | sort |
  uniq --repeated | sed 's/^/"/ ; s/$/.JPG"/' |
  xargs rm

(I have split the lines, but when you enter this into your shell, just
put it in one big, long line...)

Here's the English explaination:

  find all files | only the ones ending in .jpg or .tiff |
  chop off those file extensions | sort alphabetically |
  only show where there are identical file names | append a .JPG |
  delete this list

Easy, heh?

Just to be on the safe side though, you might want to test it without
the final '| xargs rm' (the part that does the deleting!)

It's quick and dirty, but should work.  Caveats:
  * It assumes we are doing a recusive search starting from the
    current working directory
  * I haven't tested it (on OSX) :-)
  * It assumes the files to be deleted are file.JPG (note capitals),
    however, this may not be important
  * It might choak on those filenames with spaces.  It worked for me,
    but might need some tweaking.

Just remember to test first, that 'rm' command is pretty final ;-)

Trust this helps,
Paul.


-- 
The iMac List is sponsored by <http://lowendmac.com/> and...

 Small Dog Electronics    http://www.smalldog.com  | Refurbished Drives |
 - Epson Stylus Color 580 Printers - new at $69    |  & CDRWs on Sale!  |

      Support Low End Mac <http://lowendmac.com/lists/support.html>

iMac List info:         <http://lowendmac.com/imac/list.shtml>
  --> AOL users, remove "mailto:";
Send list messages to:  <mailto:[email protected]>
To unsubscribe, email:  <mailto:[EMAIL PROTECTED]>
For digest mode, email: <mailto:[EMAIL PROTECTED]>
Subscription questions: <mailto:[EMAIL PROTECTED]>
Archive: <http://www.mail-archive.com/imac-list%40mail.maclaunch.com/>


---------------------------------------------------------------
iPod Accessories for Less
at 1-800-iPOD.COM
Fast Delivery, Low Price, Good Deal
www.1800ipod.com
---------------------------------------------------------------

Reply via email to