arrange merged data using sed

hi,

i used paste file1.txt file2.txt > file3.txt to merge 2 columns from file1 and 4 columns from file2.

file1

scaffold_217         scaffold_217

file2

CHRSM    N    scaffold_217.pf    scaffold_217.fsa

the result is as follows:-

scaffold_217    scaffold_217     
        CHRSM    N    scaffold_217.pf    scaffold_217.fsa

however, i need output like this (in 1 row separated by tab) like below:

scaffold_217    scaffold_217     CHRSM    N    scaffold_217.pf    scaffold_217.fsa

How to do this using sed or awk? would appreciate your help on this. thanks

paste -d "\t" file1 file2 > file4

i tried..it didn't work :frowning:

It works fine for me. What doesn't work about it?

Can you post the output of:

od -c file1.txt
od -c file2.txt
$ awk 1 ORS=\\t file1 file2

That just chucks everything out on a single line. Not really what paste is meant to do, I think in the context of this thread.

It's true scottn.
Anyway, my post was just meant to the provided file :wink: