Skip to content

Instantly share code, notes, and snippets.

@kkarad
Created March 20, 2014 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkarad/9676260 to your computer and use it in GitHub Desktop.
Save kkarad/9676260 to your computer and use it in GitHub Desktop.
awk merge two clusteredlines
kostas@localhost ~$ cat fix.log
2014-03-20 10:30:20,123 123456.123456789 MassQuote
2014-03-20 10:30:20,133 123456.123456789 MassQuoteAcknowledgement
2014-03-20 10:31:20,234 123456.123456789 MassQuote
2014-03-20 10:31:20,240 123456.123456789 MassQuoteAcknowledgement
kostas@localhost ~$ cat fix.log | awk '!(NR%2){printf("%s %s %s %s\n",p,$1,$2,$3)}{p=$1" "$2}'
2014-03-20 10:30:20,123 2014-03-20 10:30:20,133 123456.123456789
2014-03-20 10:31:20,234 2014-03-20 10:31:20,240 123456.123456789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment