I need help in extracting one column of numbers from many different files and display it in an output file.
Specifically, I want to extract the second column ($2
) from each file, file1.txt
, file2.txt
etc., according the the value of the first column, then place all extracted columns in a one file, out.txt
.
The problem is that the first column has different intervals in each file:
file
:
0.50 x1
1.25 x2
1.50 x3
1.75 x4
2.00 x5
file2
:
0.25 y1
0.50 y2
1.00 y3
1.25 y4
2.00 y5
Desired output:
0.25 y1
0.50 x1 y2
1.00 y3
1.25 x2 y4
1.50 x3
1.75 x4
2.00 x5 y5
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…