The UNIX and Linux Forums  

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
merging two files rameshonline Shell Programming and Scripting 14 04-06-2009 02:20 AM
Merging files ssuresh1999 UNIX for Dummies Questions & Answers 4 09-15-2008 12:29 PM
merging files vakharia Mahesh Shell Programming and Scripting 6 08-12-2008 03:23 PM
Merging two files venommaker UNIX for Dummies Questions & Answers 4 01-10-2008 08:15 AM
merging colums from different files ppass Shell Programming and Scripting 5 06-19-2006 08:26 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-13-2008
vakharia Mahesh vakharia Mahesh is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 51
Question merging two files

Friends,
os: redhat enterprise linux/SCO UNIX5.0

I have two files and I would like to merge on given key value.

Quote:
File1
111 : abcd : 75000 : newdelhi : jacob
222 : cdef : 50000 : mumbai : smith
334 : defg : 80000 : chennai : murphy
445 : dfgh : 80000 : kolkota : richard
555 : fhtk : 80000 : mumbai : gary
666 : hktk : 55000 : newdelhi : viva

file2
peter, 70000, ahmedabad, 777
jacob, 75000, newdelhi, 112
serly, 90000, nagpur, 888
rihcard, 80000, kolkata, 450
turig, 90000, newdelhi, 765
Here you can observe that the file1 is delimited with ":" and file2 with ","
and the out put I want is :

output on name base:
jacob newdelhi 75000 112 111
richard kolkota 80000 445 450

output on city base:
newdelhi 111 112 75000 jacob
kolkota 445 450 60000 richard
Now I have tried with join commd but it does not supporte multiple delimiters.
and if records length is not fixed.

join -a1 5 -a2 1 -t[;,] -o file1 file2 > outname

Can any one give details if join supports strings base join uitlity.
Thanks in advance friends.
 

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 02:18 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