Prev Up Next Index
Go backward to 9.4.6 Converting to Binary Long
Go up to 9.4 Creating a Binary Archive
Go forward to 9.4.8 Including a Query

9.4.7 Reading the Binary File

Once again, you can use readfile to check the data in the binary archive you created.

  1. Enter the following command:
    readfile latlon2.bin 
    
  2. The data are stored as longs, so enter l to view each value (or press Return to view each value after the first).
  3. Enter q to quit readfile.

If desired, you can enter the commands to readfile from an input command file rather than directly from the command line. The example command file latlon.in is shown next.

Here is latlon.in:

llllllp0 llPq 

The 6 l's (l for long) cause the first 6 values in the file to be displayed. The sequence p0 causes a return to the top (position 0) of the file. A position number (0) must be followed by a blank space. The 2 l's display the first two values again. The P displays the current file position and length, and q closes readfile.

If you enter the following command:

readfile latlon2.bin < latlon.in 

you should see the following output on the screen:

long:  -47303545
long: -176161101
long:    -928001
long:     777265
long:  -28286662
long:   35591879
New File Position = 0
long:  -47303545
long: -176161101
File Position: 8       File Length: 160

The floating point numbers have been multiplied by 106, the precision of the long variables in latlon2.fmt.


Tom Sgouros and James Gallagher, 2006-02-12

Prev Up Next