Hi,
I am new to awk, so please bear with me! I have two files:
File1:
Low High
14000 20000
25000 41000
60000 80000
File2:
Income Name
12000 smith
15000 adam
22000 john
26000 denver
I want to loop through File1, and for each range (Low to High) extract the rows in File2. So my output file should look like
Desired output:
15000 adam
26000 denver
Using awk I can loop through File2, extract the Income for each row, but how do I see if the Income is within the range in File1? My code for looping:
awk '{ for (i = 1; i <= NR; i++) print $1 }' File2
Any help guidance would be appreciated!
thanks!
I am new to awk, so please bear with me! I have two files:
File1:
Low High
14000 20000
25000 41000
60000 80000
File2:
Income Name
12000 smith
15000 adam
22000 john
26000 denver
I want to loop through File1, and for each range (Low to High) extract the rows in File2. So my output file should look like
Desired output:
15000 adam
26000 denver
Using awk I can loop through File2, extract the Income for each row, but how do I see if the Income is within the range in File1? My code for looping:
awk '{ for (i = 1; i <= NR; i++) print $1 }' File2
Any help guidance would be appreciated!
thanks!