Skip to content

Instantly share code, notes, and snippets.

@mvitaly
Last active June 6, 2017 07:15
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 mvitaly/d4c6a5bc89e0ed31c666d6444663389e to your computer and use it in GitHub Desktop.
Save mvitaly/d4c6a5bc89e0ed31c666d6444663389e to your computer and use it in GitHub Desktop.
awk pivot tab separated columns into indexed rows (starts with 0)
awk 'BEGIN{FS="\t"; offset=-1}{print "********************\nRecord number", NR, "\n********************"; for(i=1;i<=NF;i++){print i+offset, $i}; print "\n"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment