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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
accessing a file on internet chetanpc Shell Programming and Scripting 1 03-25-2008 12:07 PM
Accessing Variables from .conf file wayne1411 Shell Programming and Scripting 7 01-30-2008 01:30 PM
Accessing a log file from html, coldfusion script skrules UNIX for Dummies Questions & Answers 1 10-30-2007 10:15 AM
Accessing redirected file inside script milhan UNIX for Dummies Questions & Answers 3 02-02-2007 04:13 AM
accessing o an exact line in a file walnut Shell Programming and Scripting 2 02-23-2006 01:31 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-25-2007
Registered User
 

Join Date: Nov 2007
Posts: 4
Accessing input from another file

Hi,

Let me make it clear, Im having two .lst files.

In 1st file Im having only one column,while in 2nd im having 8 columns.

I need to take the input from 1st file, I need to check the column1 in the first file with the 3rd colmn in the 2 nd file , and only the matching records should only captured.

Like wise i need to process all the records in the 1 st and 2 nd file.

plz help me out.


Thanks,
Mohana Krishnan
Reply With Quote
Forum Sponsor
  #2  
Old 11-25-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Code:
awk 'BEGIN{ while ( getline < "a1" ) { arr[$0]++ } }{ if ( $3 in arr ) print }' a2
Always it would be better if you could post sample input and output needed !

Last edited by matrixmadhan; 11-25-2007 at 11:03 PM. Reason: sample input and output
Reply With Quote
  #3  
Old 11-25-2007
Registered User
 

Join Date: Nov 2007
Posts: 4
thanks for your response,

The matched record should be capturd in the another file.

My 1st file wl be like :

abbi~
abrego~
achen~
ahansen~
aidan~
alanbm~
alanc~
albert1~
albertl~
aliceh~

My sencond fiel will be :

0~Neo Fin Product Management Users~kellyv~
0~Neo Fin Product Management Users~kevinc~
0~Neo Fin Product Management Users~kneff~
0~Neo Fin Product Management Users~krithika~
0~Neo Fin Product Management Users~nilesh~
0~Neo Fin Product Management Users~scruton~

.I need only the matching columns n the 3 rd file.

Last edited by krishnan_6015@y; 11-25-2007 at 11:25 PM.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:04 AM.


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

Content Relevant URLs by vBSEO 3.2.0