You can use the query option (-q query_file) to specify
exactly which records in the data file newform should process.
The query file contains query criteria. Query syntax is summarized in
Appendix C.
In this example, you will specify a query so that newform will
reformat only those value pairs in latlon.dat where latitude is
positive and longitude is negative into the binary file
llposneg.bin. The input and output data formats are described in
latlon2.fmt.
The query criteria are specified in the following file, called
llposneg.qry:
[latitude] > 0 & [longitude] < 0
To convert the desired data in latlon.dat to binary and then
view the results:
newform latlon.dat -f latlon2.fmt -q llposneg.qry
-o llposneg.bin
The llposneg.bin file now contains the positive/negative
latitude/longitude pairs in binary form.
llposneg.bin
back to ASCII format:
newform llposneg.bin -f latlon2.fmt -o llposneg.dat
llposneg.dat, e.g. more:
The following output appears on the screen:
54.118314 -136.940570 27.331551 -155.233735 11.624981 -113.660611 77.652742 -79.177679 77.883119 -77.505502 35.130219 -153.543091 35.086084 -21.643402
NOTE: As demonstrated in the examples above, you can check the data in
a binary file either by using readfile or by converting the
data back to ASCII using newform and then viewing it.