1
我需要扭轉包含文本文件的字段:沖銷場與AWK
Computer science is fun
I also enjoy math
But I don't like science
我需要awk
到輸出:
line 1: Computer science is fun
line 1 reversed: fun is science Computer
line 2: I also enjoy math
line 2 reversed: math enjoy also I
.... ... 等等。 這就是我現在所擁有的:
BEGIN {print "start"}
{
for(i=NF; i>=1; i--)
{
printf "line %d: %s\n", NR , $0;
printf "line %d: reversed: %s", NR, $i;
}
}
太棒了!謝謝! – mrplow911