First page Back Continue Last page Overview Graphics
Example 3-4: awk command
continued if and awk
If we need only events with magnitude larger than 3 and smaller than 4, we do as follow,
awk '{if (substr($0,76,3) > 3 && substr($0,76,3) < 4) print substr($0,26,17), substr($0,76,3)}' earthquake_catalog.dat |more
In addition of above conditions, if we need only those events not having fixed depth, we do as follow,
awk ' {if (substr($0,76,3) > 3 && substr($0,76,3) < 4 && substr($0,55,1) != "F") print substr($0,26,17),substr($0,76,3)}' earthquake_catalog.dat