![]() |
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 |
| Search, replace string in file1 with string from (lookup table) file2? | gstuart | Shell Programming and Scripting | 9 | 06-08-2009 06:11 AM |
| insert file2 after line containing patternX in file1 | repudi8or | Shell Programming and Scripting | 5 | 04-18-2008 01:35 PM |
| echo "ABC" > file1.txt file2.txt file3.txt | ganapati | UNIX for Dummies Questions & Answers | 4 | 01-30-2008 12:36 AM |
| Awk Compare f1,f2,f3 of File1 with f1 of File2 | RacerX | Shell Programming and Scripting | 6 | 11-09-2007 01:34 AM |
| delete lines from file2 beginning w/file1 | michieka | Shell Programming and Scripting | 13 | 06-24-2003 01:42 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
match value from file1 in file2
Hi, i've two files (file1, file2) i want to take value (in column1) and search in file2 if the they match print the value from file2.
this is what i have so far. awk 'FILENAME=="file1"{ arr[$1]=$1 } FILENAME=="file2" {print $0} ' file1 file2 |
|
||||
|
Hi Jim, thanks this is working.
what should i do if i want to compare file2 (col1) not in file1 (Anywhere in file). then print the line from FILE2. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|