The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to merge these two files? fedora Shell Programming and Scripting 3 02-12-2008 06:45 PM
use of sed over cat to merge files miwinter UNIX for Advanced & Expert Users 2 11-28-2007 01:36 PM
How to merge files lestat_ecuador Shell Programming and Scripting 3 06-07-2007 06:45 AM
help in merge files u263066 Shell Programming and Scripting 5 07-24-2006 03:24 AM
Using NAWK to merge two files madhunk Shell Programming and Scripting 7 06-07-2006 10:27 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-24-2007
koti_rama koti_rama is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 50
merge files

Hi,
i have the files f1 and f2 like:
files f1:
c1 a1
c2 a2
c3 a3
file f2:
c1 b1
c2 b2
c3 b3

i want merge the f1 and f2 file to f3 file like:

c1 a1 b1
c2 a2 b3
c3 a3 b3........
....
.
.
please help me onthis.....

Last edited by koti_rama; 12-24-2007 at 01:44 AM..
  #2 (permalink)  
Old 12-24-2007
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,507
check the join man page
  #3 (permalink)  
Old 12-24-2007
thanusha thanusha is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 2
Quote:
Originally Posted by koti_rama View Post
Hi,
i have the files f1 and f2 like:
files f1:
c1 a1
c2 a2
c3 a3
file f2:
c1 b1
c2 b2
c3 b3

i want merge the f1 and f2 file to f3 file like:

c1 a1 b1
c2 a2 b3
c3 a3 b3........
....
.
.
please help me onthis.....
Hi
use paste command for this senario,I think it will be help to u.
Paste F1 F2 > F3
  #4 (permalink)  
Old 12-24-2007
thanusha thanusha is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 2
Hi
use paste command for this senario,I think it will be help to u.
Paste F1 F2 > F3
  #5 (permalink)  
Old 12-24-2007
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,507
Quote:
Originally Posted by thanusha View Post
Hi
use paste command for this senario,I think it will be help to u.
Paste F1 F2 > F3
have you tried it? does it give the correct output OP wants?
  #6 (permalink)  
Old 12-24-2007
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 750
Quote:
Originally Posted by koti_rama View Post
Hi,
i have the files f1 and f2 like:
files f1:
c1 a1
c2 a2
c3 a3
file f2:
c1 b1
c2 b2
c3 b3

i want merge the f1 and f2 file to f3 file like:

c1 a1 b1
c2 a2 b3
c3 a3 b3........
....
.
.
please help me onthis.....

Code:
join -j 1 -o 1.1 1.2 2.2 f1 f2 > f3
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0