If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Merging files in a single one USING AWK

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-02-04, 22:50
nauke nauke is offline
Registered User
 
Join Date: Nov 2004
Posts: 3
Merging files in a single one USING AWK

hi all!

i'm an awk newbie and have been trying in vain to merge two files together.

ie.

file1.txt:

a b c
e f g
h i j

file2.txt:

1 2 3
4 5 6
7 8 9

i want to end up with:

a b c 1 2 3
d e f 4 5 6
h i j 7 8 9

so basically i want to append every line in file2.txt to every line in file1.txt

in a previous thread (http://www.dbforums.com/t999021.html) it mentions the use of AWK to do this, i've been looking all over the internet trying to find a way to do this as i have no idea how to go about it!

can someone help?
thanku!
Reply With Quote
  #2 (permalink)  
Old 11-03-04, 00:03
nauke nauke is offline
Registered User
 
Join Date: Nov 2004
Posts: 3
i didnt realize that one of the replies to a similar problem to mine was actually a command, eek!

anyway for those who may browse this, this is the solution!
as seen in: http://www.dbforums.com/t999021.html

paste file1.txt file2.txt > file3.txt

(for those who didnt know like me, 'paste' is actually a command!


ciao!
nicole/nauke
Reply With Quote
  #3 (permalink)  
Old 11-03-04, 00:05
nauke nauke is offline
Registered User
 
Join Date: Nov 2004
Posts: 3
ps. no this is not an awk solution, but it works great and is simple so ...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On