Search Results

Search: Posts Made By: mikezang
4,192
Posted By Scrutinizer
awk 'NR==FNR{if (!/^\/\*/) A[$1]=$3; next} $1 in...
awk 'NR==FNR{if (!/^\/\*/) A[$1]=$3; next} $1 in A && !/^\/\*/{$3=A[$1]}1' B A
4,192
Posted By pamu
awk 'FNR==NR{if($0 ~...
awk 'FNR==NR{if($0 ~ /^\//){a[$4]=$0}else{a[$1]=$3};next}{
if($0 ~ /^\//){print a[$4]?a[$4]:$0}else{if(a[$1] != $3){print $1,$2,a[$1]?a[$1]:$3}else{print $0}}}' file2 file1
4,192
Posted By bartus11
A bit shorter: awk...
A bit shorter: awk 'NR==FNR&&/^\/\*/{x=$0;getline;a[x]=$0;next}/^\/\*/{x=$0;print;getline;$0=a[x]?a[x]:$0;printf $0"\n\n"}' B A
Showing results 1 to 3 of 3

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