Linux中将一列变成两列
如何用shell 实现将一列分为两列 ???
1
2
3
4
5
6
7
8
变成下面这样
1 2
3 4
5 6
7 8
用shell 能实现吗??? 不仅限于shell 其他命令也行??
seq 10|awk 'ORS=NR%2?"\t":"\n"'
xargs -n2 <filename
hn_lwdian 发表于 2013-1-16 16:53 static/image/common/back.gif
xargs -n2
试了 可以 非常感谢:handshake
xargs -n2 <ab
1 2
3 4
5 6
7 8
seq 1 8 | sed 'N;s/\n/\t/'
sed 'N;s/\n/ /g'
怎样把2列变成1列呢
LCY 发表于 2013-2-22 14:05 static/image/common/back.gif
怎样把2列变成1列呢
cat file
1 2
3 4
sed 's/ /\n/'
1
2
3
4
怎么能没有paste呢。
seq 6|paste - -
1 2
3 4
5 6
LCY 发表于 2013-2-22 14:05 static/image/common/back.gif
怎样把2列变成1列呢
awk 'BEGIN{RS=" "}1'
seq 10|xargs -n 2
用xargs方便

浙公网安备 33010602011771号