In this example, you will use newform to reformat the latitude
and longitude values in the ASCII data file latlon.dat into
binary longs in the binary file latlon2.bin. The input and
output data formats are described in latlon2.fmt.
This is what's in latlon2.fmt:
/ This is the format description file for data files latlon.dat / and latlon2.bin. Each record in both files contains two fields, / latitude and longitude. ASCII_data "ASCII format" latitude 1 10 double 6 longitude 12 22 double 6 binary_data "binary format" latitude 1 4 long 6 longitude 5 8 long 6
The ASCII and binary variables both have the same names. The ASCII variable latitude occupies positions 1-10 and longitude occupies positions 12-22. The ASCII variables are defined to be of type double. The binary variables occupy four bytes each (positions 1-4 and 5-8) and are of type long. The precision for all is 6.