Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Removing files from corrupted iPhoto Library nested folders

Removing files from corrupted iPhoto Library nested folders
Thread Tools
bkb
Dedicated MacNNer
Join Date: Sep 2003
Status: Offline
Reply With Quote
Aug 11, 2005, 10:11 AM
 
I am trying to extract all the .jpgs from a corrupted iPhoto Library folder. I don't want to remove any of the thumbnails in there, so am using this command:

cp `find * | grep -i jpg | grep -v Thumbs` ~/iPhotoNew

The one issue here is that if two .jpgs have the same filename the command will overwrite the first with the second and I will lose some photos. Ideally what'd I'd like to do is rename each file that is being copied in a simple sequence: 1.jpg, 2.jpg, 3.jpg, etc. How do I build this into my command?

Thanks.
(Last edited by bkb; Aug 11, 2005 at 10:19 AM. )
PBG4/12"/1GHz/1.25GB/60GB//SD/APX/10.3
     
Mac Elite
Join Date: May 2001
Location: Earth
Status: Offline
Reply With Quote
Sep 6, 2005, 06:30 AM
 
Something like this (assuming you are using the default shell [bash])

i=1 ; find * | grep -i jpg | grep -v Thumbs | while read file ; do cp $file ~/iPhotoNew/$i.jpg ; i=$(expr $i + 1) ; done
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:01 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2