for 循环太慢了。文件有 500k 行。我想专门加入所有文件的第四列。逐列追加。
每个文件中的列由制表符分隔。
col1 col2 col3 col4 col5
a 0 0 -1 0.001
b 1 0 2 0.004
c 2 0 3 0
col1 col2 col3 col4 col5
c 2 0 -9 0.004
s 1 0 5 0.002
d 3 0 3 0.4
col1 col2 col3 col4 col5
r 2 1 0 0.4
j 1 1 1 0.2
r 3 1 2 0.1
我想要:
file1 file2 file3
-1 -9 0
2 5 1
3 3 2
我尝试使用 awk,但它只是将它们添加到以下行而不是侧面(作为一列)。
你有什么建议?
我想我找到了一个简单的修复方法,但我缺少 file_names 的标题:
awk '{print $4}' file* | pr -400 -t > out