Renaming files by date and model Topic is solved

Using PhotoRec to recover lost data
Locked
Message
Author
m0atz
Posts: 5
Joined: 28 Jun 2014, 22:11

Renaming files by date and model

#1 Post by m0atz » 05 Aug 2014, 21:33

Ok so I got a whole load of photos back from photorec - as usual it was the best tool for the job.

Now, I've used the following code to rename by any available timestamp in the exif information:

Code: Select all

for i in ./*.jpg; do cp $i ../final/`exiv2 -p s $i | grep timestamp | awk '{ print $4 "-" $5 }'`.jpg; done
and then I've also tried to prepend that with the model number:

Code: Select all

for i in *.jpg; do mv $i `exiv2 -p s $i | grep model | awk '{ print $4 }'`-$i; done
Doing this will prepend the file with say "iphone-2014...jpg" but can it be clearer on the model, i.e. some are iPhone 4 and some are iPhone 5 - how can I get it to give the full model description.

Also - is there a way to Append the info as opposed to prepend it and also skip over any errors?

Thanks

Sponsored links

User avatar
cgrenier
Site Admin
Posts: 3813
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: Renaming files by date and model  Topic is solved

#2 Post by cgrenier » 13 Aug 2014, 18:26

To append the model, try

Code: Select all

for i in *.jpg; do mv $i $i-`exiv2 -p s $i | grep model | awk '{ print $4 }'`; done

m0atz
Posts: 5
Joined: 28 Jun 2014, 22:11

Re: Renaming files by date and model

#3 Post by m0atz » 13 Aug 2014, 18:38

Awesome thank you Mr. Grenier.

Locked

Who is online

Users browsing this forum: No registered users and 1 guest