Skip to content

Instantly share code, notes, and snippets.

@aminamid
Last active October 27, 2015 10:17
Show Gist options
  • Select an option

  • Save aminamid/c7a70ac9941dda14b854 to your computer and use it in GitHub Desktop.

Select an option

Save aminamid/c7a70ac9941dda14b854 to your computer and use it in GitHub Desktop.
lg sum
cat /vol2/home/bounce/opwv_pac/lg_smpl/log/smtp_smpl_1/smtp_128.stat | sed -E "s/^\t([^\t ]+)(( [^\s]+){0,})\t\s*/\t\1 /; s/ {1,}/ /g;" | sed -E ":a;N;s/\n\t/ /;t a;P;D" | sed -E "s/^(....)(..)(..) (..)(..)(.)..*\) /\1-\2-\3T\4:\5:\60 /; s/[][] ?/ /g;"
for f in $(ls *stats); do cat ${f} | sed -E "s/^\t([^\t ]+)(( [^\s]+){0,})\t\s*/\t\1 /; s/ {1,}/ /g;" | sed -E ":a;N;s/\n\t/ /;t a;P;D" | sed -E "s/^(....)(..)(..) (..)(..)(.)..*\) /\1-\2-\3T\4:\5:\60 /; s/[][] ?/ /g;" > ${f}.csv; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment