Search Results

Search: Posts Made By: bharathbangalor
2,461
Posted By Akshay Hegde
If you just want to print file1 header you can...
If you just want to print file1 header you can use this

$ awk 'FNR==NR{A[$1]=$2 FS $3;next}FNR==1{print}($1 in A){$0=$0 FS A[$1]}A[$1]' file2 file1
ID Name phone_no
205 mno 90808 bangalore...
2,461
Posted By Franklin52
Try: awk 'NR==FNR{a[$1]=$0; next} $1 in a...
Try:
awk 'NR==FNR{a[$1]=$0; next} $1 in a {print a[$1], $2, $3}' file1 file2
19,519
Posted By RudiC
Based on the data in your post#1, tryawk ...
Based on the data in your post#1, tryawk 'FNR==1 {for (n=1; n<=NF; n++) {if ($n==ID) IDCOL=n; if ($n==RES) RESCOL=n}; print $IDCOL, $RESCOL; next}
$IDCOL==SRCH {print $IDCOL,...
19,519
Posted By Akshay Hegde
what is the meaning of this ??? you posted in #3...
what is the meaning of this ??? you posted in #3 :mad:

Use this code when you post next time be specific about your requirement and make sure that others will understand your requirement.

$ cat...
Showing results 1 to 4 of 4

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