Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Renaming Emails
- isolate Sent Date
- Identify emails with attachments
- rename folder in emails
- rename emailname
- ## isolate Sent Date
- grep -H -o -e "<td>\([0-9-]\+\ [0-9:]\+<\/td>\)" ./*.html > __email_sent_dates_-_Inbox.list
- grep -H -o -e "Sent:.*<td>\([0-9-]\+\ [0-9:]\+<\/td>\)" ./*.html
- "[0-9-]+ [0-9:]+"
- YYYY-mm-dd HH:MM:SS
- ## Identify emails with attachments
- xmlstarlet fo -o -R -H -D skip.html 2>/dev/null | xmlstarlet el -a | sort -u | less
- ls -1 *.html | while read line; do echo "$line" ; xmlstarlet fo -o -R -H -D "$line" 2>/dev/null | xmlstarlet sel -t -v '//html/body/font/table/tr[2]/td[2]' -o " -- " -v '//html/body/font/table/tr[1]/td[2]' -o " -- " -v '//html/body/font/table/tr[3]/td[2]' -n | sed -e 's/\&[gl]t;/\|/g'; done
- cat __email_sent_dates_-_Inbox_full.list | while read line; \
- do \
- FNAME=$(echo "$line" | awk -F ":Sent:" '{print $1}'); \
- NFNAME=$(echo "$line" | awk -F ":Sent:" '{print $1}' | sed -e 's/\.\///' -e 's/ /_/g' -e "s/'//g"); \
- DATTIME=$(echo "$line" | awk -F "<td>" '{print $2}' | sed -e 's/<\/td>//' -e 's/[:-]//g' -e 's/ /_/'); \
- echo "$FNAME" " --> ./"$DATTIME"__"$NFNAME; \
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement