For a file with a name employee.txtin the format (Firstname, Lastname, Salary) with a space as a field separator:
Foo Bar $1,000
First Last $5,550
Abc Def $3,000
Qaru $6000
Help Please $4700
I want to print lines that have a third field over 4000 dollars. Desired conclusion:
First Last $5,550
Qaru $6000
Help Please $4700
I am not sure how to check if the field is greater than 4000, for example, with $and ,in it.
I tried to use sedto replace $and ,gaps, and then redirect to awk, but I want to output kept $and ,like the original.
Can this be done with awk?
source
share