用awk合并行(转)[@more@]
四行合一行
[code:1:bde308dcc7]
cat filename
111111111
222222222
333333333
444444444
555555555
666666666
777777777
888888888
999999999
awk '{if (NR%4==0){print $0} else {printf"%s ",$0}}' filename
111111111 222222222 333333333 444444444
555555555 666666666 777777777 888888888
999999999
[/code:1:bde308dcc7]
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8225414/viewspace-944816/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8225414/viewspace-944816/