Skip to content

Instantly share code, notes, and snippets.

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