用脚本一列变三行
比如1.txt内容:
1
2
3
4
5
6
7
处理后应该是:
1 2 3
4 5 6
7
可使用sed命令完成:
[root@localhost ~]#sed 'N;N;s/\n/ /g' 1.txt
运行结果
[root@ansinble_center tmp]#cat 1.txt
1
2
3
4
5
6
7
[root@ansinble_center tmp]#sed 'N;N;s/\n//g' 1.txt
123
456
7
[root@ansinble_center tmp]#cat 1.txt
1
2
3
4
5
6
7
[root@ansinble_center tmp]#sed 'N;N;s/\n/ /g' 1.txt
1 2 3
4 5 6
7