taking first column of one file and making it the first column of a second file in perl or unix -


examples:

file 1 :

contig01  contig02  contig03  contig04 

file 2: (tab delimitated)

9.8 5.4 5.7 8.7   5.6 4.5 6.4 4.6  3.4 4.3 2.4 4.5  3.4 3.6 6.5 3.5 

i want file merges them get

contig01 9.8 5.4 5.7 8.7   contig02 5.6 4.5 6.4 4.6  

etc

the files in same order

thanks

you want paste command.

$ cat <<eof >file1 > contig01 > contig02 > contig03 > contig04 > eof  $ cat <<eof >file2 > 9.8 5.4 5.7 8.7 > 5.6 4.5 6.4 4.6 > 3.4 4.3 2.4 4.5 > 3.4 3.6 6.5 3.5 > eof  $ paste file1 file2 contig01        9.8 5.4 5.7 8.7 contig02        5.6 4.5 6.4 4.6 contig03        3.4 4.3 2.4 4.5 contig04        3.4 3.6 6.5 3.5 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -