![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with selecting specific lines in a large file | tansha | UNIX for Dummies Questions & Answers | 2 | 02-06-2008 08:26 AM |
| Count No of Records in File without counting Header and Trailer Records | guiguy | Shell Programming and Scripting | 2 | 06-07-2007 12:15 PM |
| Select records based on search criteria on first column | shashi_kiran_v | UNIX for Dummies Questions & Answers | 2 | 12-02-2005 01:49 PM |
| selecting each paragraph and put it into a file...help me | swamymns | Shell Programming and Scripting | 2 | 10-04-2005 11:46 AM |
| Archiving Files by selecting years file created | dmhammond | UNIX for Dummies Questions & Answers | 2 | 06-13-2005 02:12 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
Can I have 2 files as in input to the awk command?
Situation is somewhat below, File A contains number & value delimited by a space. File B contains number as a part of a line. I am not supposed to retrieve more than 1 number from a line. If number from file B matches with number from file A, then I will retrieve value part from file A. I will store this found, number - value pair in file C. Would it be possible with single awk command? Or is there any suggestions to implement this? |
|
||||
|
Bhargav
if I use exec my telnet window disappears. None of your solutions suggested work for me. I have to read file A, read a number Read file B search for this number & extract description beyond it. File A xxxx1111yyyyy aaaa2222bbbbb cccc3333ddddd File B 1111 desc1 2222 desc2 I know, awk deals with only 1 file. Any suggestions? |
|
||||
|
It seems to me if you gave us all of the requirements up front you would get a better answer.
What is your exact output supposed to be? just the description? Or the common number field followed by the description? try Code:
man join Based on your requirements so far: Code:
awk ' { print substr($0,4,4) } ' file1 | sort -u tmp.sed
grep -f tmp.sed file2 | awk ' { print $2 } '
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|