只有2行的情况:sed 'N;s/\n/\t/g' file
只有3行的情况:sed 'N;N;s/\n/\t/g' file
xargs -n2 <file(不适用于每行多列的情况)
如果有n行,每行不只一列:
awk '{if(NR%2==0)print ;else printf "\t"}' file #2行并为1行
awk '{if(NR%3==0)print ;else printf "\t"}' file #3行并为1行
文章来源于领测软件测试网 https://www.ltesting.net/










