- #1
RJLiberator
Gold Member
- 1,095
- 63
Homework Statement
use awk to create a subset of the original data file called subset.gmt that only contains records with longitudes between -112 and -102. Hint: you can use the operator && to tell awk to look for more than one pattern at once.
Homework Equations
The Attempt at a Solution
What we need is to find an awk command that allows me to take the data from a previous file, the column 1 (longitude) and take only the records between -112 and -102.
So, I understand we start the command as such:
awk 'NR>1{print $1...}' originalfile.txt >! newoutput.ps
The column that I want to pull from is 1 from the file.
But how do I create a code such that it pulls only the records between -112 and -102?
Is it an if statement? Professor mentions the use of boolean operator &&, but I've searched the internet with no luck...
Thank you.