|
藍森林 http://www.lslnet.com 2006年6月26日 11:18
請教如何用awk把一個文件有2列拆成2個文件,每個文件各一列
2 3
1 3
4 5
原文件譬如如上,請教如何拆成2個文件
一個
2
1
4
另一個
3
3
5
都是txt文件
謝謝! |
[code]
/home/lee#cat a|tr -s ' '|tee >(cut -f1 -d' '>aa)|cut -f2 -d' '>bb
/home/lee#cat aa
2
1
4
/home/lee#cat bb
3
3
5
/home/lee#echo $0
bash
/home/lee#
[/code] |
awk '{print $1>"file1"}{print $2>"file2"}' |
-->
Y
這個我也知道 |
-->
活學活用啊!!!!!!!!!!!!!!!!暈,我沒想到 |
| |