bash - Exclude a column when pasting two data files -
i have 1 file "dat1.txt" like:
0 5.71159e-01 1 1.92632e-01 2 -4.73603e-01
and file "dat2.txt" is:
0 5.19105e-01 1 2.29702e-01 2 -3.05675e-01
to write combine these 2 files 1 use
paste dat1.txt dat2.txt > data.txt
but not want 1st column of 2nd file in output file. how modify unix command?
paste dat1.txt <(cut -d" " -f2- dat2.txt)
using cut
remove column 1, , using process substitution use output in paste
output:
0 5.71159e-01 5.19105e-01 1 1.92632e-01 2.29702e-01 2 -4.73603e-01 -3.05675e-01
Comments
Post a Comment