Search Results

Search: Posts Made By: looty
6,272
Posted By RudiC
When working on the first input (file2), NR ==...
When working on the first input (file2), NR == FNR, it collects field 2's values into an array indexed by field 1.
When working on the second, it checks if field 3 begins with sign, and replaces...
6,272
Posted By RudiC
Try awk -F, 'NR==FNR {T[$1]=$2; next} $3 ~...
Try
awk -F, 'NR==FNR {T[$1]=$2; next} $3 ~ /^sign/ {$3=T[$1]} 1' OFS=, file2 file1
empname,place,empdep
aaaa ,city1,001
bbbb,city2,002
dddd,city1,005
ffff,city5,007
hhhh,city7,009
Showing results 1 to 2 of 2

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