Search Results

Search: Posts Made By: manojmalhotra
3,034
Posted By Akshay Hegde
Try this awk 'NR==FNR{a[$1]=$2;next;}{print...
Try this

awk 'NR==FNR{a[$1]=$2;next;}{print $1, $2, ( ($1 in a) ? a[$1] : "00000000"); delete a[$1] }END{for(i in a)print i,a[i],"not-exists-in-file1"}' file2 file1
3,034
Posted By Akshay Hegde
Modify like this awk...
Modify like this

awk 'NR==FNR{a[$1]=$2;next;}{print $1, $2, ( ($1 in a) ? a[$1] : "00000000") }' file2 file1 >file3
278,921
Posted By Neo
Simple rules of the UNIX.COM forums:
RULES OF THE UNIX AND LINUX FORUMS

For the latest version of the community rules (the official community rules page), please visit here. (https://www.unix.com/misc.php?do=cfrules)


No flames,...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 10:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy