Created
March 3, 2020 10:52
-
-
Save xai/22caa409a980435a831bfc3893c9a228 to your computer and use it in GitHub Desktop.
reverse words in second column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
OFS=FS | |
n=split($2, words, " ") | |
$2="" | |
for(i=n;i>=1;i--) $2=$2 words[i] " " | |
gsub(/ +$/, "", $2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment