Skip to content

Instantly share code, notes, and snippets.

@dshaw002
Created March 8, 2016 15:46
Show Gist options
  • Save dshaw002/d8891ae3612a5556314b to your computer and use it in GitHub Desktop.
Save dshaw002/d8891ae3612a5556314b to your computer and use it in GitHub Desktop.
Notes on Searching for file metadata through lots of directories!
Problem: Need to search files in subdirectory for metadata
Solution:
1) Find files and matches and output to data file
a) Use find to get loop of files..
b) identify -verbose to get metadata of files..
c) grep to get lines around match..
d) cat to output it to results file
2) Make sense of response data
a) Reverse lines because searching backwards in regex is idk
b) Do match search to get data
c) No sublime, grep with PCRE multiline
d) MACOSX caveat: MAC uses FreeBSD grep, need to use homebrew dups with grep to get GNU grep labelled ggrep in command line
e)
3) Profit
4) Better method is to use identify -format "%d%f %[IPTC:2:60] %[IPTC:2:110] %[IPTC:2:160]" but I messed up so had to go long way :-(
Better Solution... Improve the identify to get the tags for iptc metadata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment