Skip to content

Instantly share code, notes, and snippets.

@karlcow
Created April 3, 2013 14:47
Show Gist options
  • Save karlcow/5301846 to your computer and use it in GitHub Desktop.
Save karlcow/5301846 to your computer and use it in GitHub Desktop.
Getting the in/out date of my IRC chat log
Not really optimized but does the job.
grep -h "^\*\*\*\* .* \(LOGGING\|JOURNAL\)" FreeNode-\#joiito*.txt | sed -e "s/\*\*\*\* ENDING LOGGING AT /end /" | sed -e "s/\*\*\*\* FIN DU JOURNAL À/end /" | sed -e "s/\*\*\*\* BEGIN LOGGING AT /beg /" | sed -e "s/\*\*\*\* DÉBUT DU JOURNAL À/beg /" | sed -e "s/\(...\) *\(...\) \(...\) \(..\) \(..:..:..\) \(....\)$/\6-\3-\4T\5 \1/" | sed -e "s/Jan/01/" | sed -e "s/Feb/02/" | sed -e "s/Mar/03/"| sed -e "s/Apr/04/" | sed -e "s/May/05/" | sed -e "s/Jun/06/" | sed -e "s/Jul/07/" | sed -e "s/Aug/08/" | sed -e "s/Sep/09/" | sed -e "s/Oct/10/" | sed -e "s/Nov/11/" | sed -e "s/Dec/12/" | sed -e "s/\(....-..-\) /\10/" | sort > log-joiito.txt
The results is something along
2013-03-25T16:41:43 end
2013-03-25T17:40:49 beg
2013-03-26T13:51:12 end
2013-03-26T17:23:41 beg
2013-03-27T12:06:55 end
2013-03-27T15:25:18 beg
2013-03-30T12:30:06 end
2013-03-30T17:21:50 beg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment