The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Left join on files using awk
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Left join on files using awk
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
05-27-2009
devtakh
Registered User
Join Date: Oct 2007
Location: Bangalore
Posts: 514
Code:
awk 'FNR==NR{a[$1]++;next}{if($1 in a)print $1,"Found"; else printf("%s%s\n", $1,OFS)}' OFS="," B A
-Devaraj Takhellambam
devtakh
View Public Profile
Find all posts by devtakh
Find devtakh's past nominations received
Find devtakh's present nominations given