![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
awk 'BEGIN{ while ( getline < "a1" ) { arr[$0]++ } }{ if ( $3 in arr ) print }' a2
Last edited by matrixmadhan; 11-25-2007 at 11:03 PM. Reason: sample input and output |
|
#3
|
|||
|
|||
|
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. |
|||
| Google The UNIX and Linux Forums |