![]() |
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 |
| compare columns from seven files and print the output | smriti_shridhar | Shell Programming and Scripting | 7 | 06-11-2008 12:22 AM |
| awk to compare lines of two files and print output on screen | chlfc | Shell Programming and Scripting | 3 | 03-24-2008 04:16 AM |
| to compare two files and to print the difference | cdfd123 | Shell Programming and Scripting | 5 | 10-06-2007 04:55 AM |
| compare 2 file and print difference in the third file URG PLS | evvander | Shell Programming and Scripting | 3 | 09-24-2007 06:52 AM |
| Compare dates in a field and print the latest date row | cvkishore | Shell Programming and Scripting | 1 | 08-04-2007 07:58 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
compare two files and print the last row into first
suppose
fileA vis vis gyh gye gyh fileB vis 23 gyh 21 gye 32 output shud be like in fileA ... vis 23 vis 23 gyh 21 gye 32 gyh 21 Last edited by cdfd123; 04-27-2008 at 08:05 AM.. Reason: coloring |
|
||||
|
Code:
awk 'NR==FNR{a[$1]=$2;next}$2=a[$1]' fileB fileA
|
| Sponsored Links | ||
|
|