The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to read record by record from a file in unix raoscb UNIX for Dummies Questions & Answers 1 05-16-2008 03:30 AM
join (pls help on join command) summer_cherry Shell Programming and Scripting 1 12-31-2007 01:19 AM
Script to search a bad record in a file then put the record in the bad file shilendrajadon UNIX for Advanced & Expert Users 1 12-28-2007 06:00 AM
splitting a record and adding a record to a file rsolap Shell Programming and Scripting 1 08-13-2007 10:58 AM
seaching field and getting complete record mahabunta UNIX for Dummies Questions & Answers 4 08-28-2006 01:52 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2008
Registered User
 

Join Date: Jun 2008
Posts: 6
Stumble this Post!
To output complete record with JOIN

Hi

I have 2 files

file1

12312341231612634
34534368463786347
23472364287687263
23472357841007237

file2

12123561235176351*dhfsdhfh*2347623462*sdfjshehweu*123651235*sdgfsgfsy*23237346*
23472357841007237*defsjdf*12378234*hsdhfsdhgfsh*12837238947*dsjshgdfs*2348972348*
12312376234237868*fvdfvd*2342783239487*sdfsjefhsd*27236*sdhfsdhfs*2347234*

I want to use join in get those records that are present in file1 from file2 and want the complete line.

I dont want to use grep since the file size is high and it would take a long time to search for each record.

I am using Join

join -j1 1 -j2 1 file1 file2 -o ("I want complete row") cannot use 2.1 2.2 2.3 and so on as there are more than 100 fields.

Please suggest a solution.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-04-2008
Registered User
 

Join Date: Jun 2008
Posts: 6
Stumble this Post!
reply

Thanks got the output

join -t "*" -j1 1 -j2 1 file1 file2 > output

This wil give complete record.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0