My photos are arranged in one of two methods:
- If I've been on a trip, I create a 'collection' called eg "NZ_Sept_2011" and in there sub-folders for each camera eg "D300" and the sub-folders eg "NEFs" and "JPGs".
- For
regular day to day stuff, I create numerical based folders eg
"Nikon_01200" which would contain Nikon photos from 01201 to 01300.
- Creating a listing of all my photos with their modification date, so in theory I can just recursively list all files.
- Then I need to process the results, shedding extraneous data, and the year, so I'm left with just Day and Month and full path of the file
Here's what I came up with:
6 comments:
You could just use awk and find:
find /dir/to/pictures -type f \( -name "*.jpg" -or -name "*.JPG" \) -exec ls -lrSo {} \; | awk '{printf "%s %s %s,",$5,$6,$7; for(i=8;i<=NF;i++){ printf "%s ", $i } print "" }'
-humbytheory
Woops, you wanted last modification time.. (need to add 'u' to the 'ls' commnd):
find /dir/to/pictures -type f \( -name "*.jpg" -or -name "*.JPG" \) -exec ls -lrSou {} \; | awk '{printf "%s %s %s,",$5,$6,$7; for(i=8;i<=NF;i++){ printf "%s ", $i } print "" }'
-humbytheory
thanks! I made a couple of alterations: removed the 'year' field, and fed through sed to turn into a CSV:
find /path/to/photos/ -type f \( -name "*.jpg" -or -name "*.JPG" \) -exec ls -lrSou {} \; | awk '{printf "%s %s,",$5,$6; for(i=8;i<=NF;i++){ printf "%s ", $i } print "" }' | sed s:" /":,/:g > all_1.csv
Then upload into Google Docs, add the top line, create pivot, job done.
Easy as!
For some reason, your second option ie using 'u' produces the wrong dates on my OSX box. Using the first gives file system system modification time, which is usually what I'm what I'm looking for
why not use
find /foo/bar -type f -name '*.jpg'
rather than grep out the unwanted entried
well I could, but I need the date/time stamp of the file. The previous suggestion / comment works really quite well.
Post a Comment