I have two files (tab delimited) one file is has 4 columns and n number of rows and second file has 2 columns and n number of rows.
column 4 of first file is identical to column 2 of second file.
I want to have a third file which contains first four columns from file 1 and column 5 from file 2.
Any suggestions for one line bash script.
Select the files you want to merge using the Acrobat PDF combiner tool. Reorder the files if needed. Click Merge files. Sign in to download or share the merged file.
You can directly merge Google Documents with your drive.
try with join
join FILE1 FILE2 -1 4 -2 2 -t"tab"
to express a join between the files FILE1 and FILE2 based on the 4th field (-1 4
) of FILE1 and the 2nd field (-2 2
) of FILE2
Have a look at the join
command, see guide here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With