Skip to content

Instantly share code, notes, and snippets.

@xai
Created March 3, 2020 10:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
reverse words in second column
{
OFS=FS
n=split($2, words, " ")
$2=""
for(i=n;i>=1;i--) $2=$2 words[i] " "
gsub(/ +$/, "", $2)
print
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment