Skip to content

Instantly share code, notes, and snippets.

@digitalex
Created March 14, 2012 08:51
Show Gist options
  • Select an option

  • Save digitalex/2035199 to your computer and use it in GitHub Desktop.

Select an option

Save digitalex/2035199 to your computer and use it in GitHub Desktop.
Order fields so the shortest is first
awk 'length($1) > length($2) {tmp = $2; $2 = $1; $1 = tmp} {print $0}' input.log > output.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment