Created
July 6, 2015 03:18
-
-
Save vermiculus/4dc2e514fbc152dc3c66 to your computer and use it in GitHub Desktop.
Turn a directory full of emails into timestamped org entries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in `ls *.eml`; do | |
eml_date=`grep Date: $f | head -n 1 | sed 's/.*, \(.*\) +.*/\1/'` | |
#gtouch -d "$eml_date" $f #update timestamp | |
org_date=`date -j -f '%e %b %Y %T' "$eml_date" "+[%Y-%m-%d %H:%M:%S]"` | |
echo "* $org_date `grep From: $f | head -n 1 | sed 's/.*: \(.*\)/\1/'`" | |
cat $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment