|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to paste second file into the first file
Hello,
I am new to Unix and hoping that someone could help me with this. I have 2 different text files that has more than 300,000 rows and would like to paste a single column on the File 2 as the very last column of File 1. Example, File 1: AAA DDD VVV RRR AAA DDD VVV RRR BBB HHH GGG SSS QQQ ZZZ HHH RRR File2: TTT TTT TTT TTT What I want is: AAA DDD VVV RRR TTT AAA DDD VVV RRR TTT BBB HHH GGG SSS TTT QQQ ZZZ HHH RRR TTT I tried to use: paste -d "\t" file2 file1 but for some reason it got pasted as the first column instead of the last column. Any help would be greatly appreciated! Thank you so much |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
you should interchange the filenames Code:
paste -d "\t" file1 file2 |
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
Why not just: Code:
paste file1 file2 Guru. |
|
#4
|
|||
|
|||
|
Hello, Thank you for the responses.
I tried both of the codes and it gives me this: (I am showing you a single line, just a very long sequence. File 1 is shown in blue and file 2 is shown in red) June2012 57 928824 TACATCCGTAATATACATATATATATATATATATATATATATATGTATGAGTCGTGGAAGAACCAAATCATATTCACCACTACAGCACGTCGTAGCTAGT ATAGAATAAAGAGCTCAAAGAAAAAGGAACGTTATATATATGATCAGATTTCATGCTTATGTTCTACATATTATGGTTTTTCTATACTGACATTAACTGT ATTATACTATATATATTACACCGTGTTCACPos(+)CGGCCAGAATTAAGAAAC I don't understand why the file 2 pasted in the middle of file 1, instead of separated by a tab after the very last column of file 1. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Paste text into vi file? | palex | OS X (Apple) | 21 | 10-29-2012 07:57 PM |
| Help required the cut the whole contents from one file and paste it into new file | acidburn_007 | Shell Programming and Scripting | 4 | 06-13-2012 03:23 AM |
| awk read value from file and paste in other file | tobias1234 | Shell Programming and Scripting | 10 | 04-18-2012 03:52 AM |
| Cut paste from one file to other | swapsb | UNIX for Dummies Questions & Answers | 9 | 02-03-2011 02:08 AM |
| Paste content of a file to another file and make it as columned | kingpeejay | Shell Programming and Scripting | 6 | 06-20-2009 05:40 PM |
|
|