newformreadfilechkformThough newform is useful for checking data formats, it is
limited by requiring a format file to specify an output format. Since
some FreeForm ND applications (such as the OPeNDAP FreeForm handler) do not
require an output format, this is extra work for the dataset
administrator. For these occasions, FreeForm ND provides a simpler
format-checking program, called chkform.
The chkform program attempts to read an ASCII file, using the
specified input format. If the format allows the file to be read
properly, chkform says so. However, if the input format
contains errors, or does not accurately reflect the contents of the
given data file, chkform delivers an error message, and attempts
to provide a rudimentary diagnosis of the problem.
You must create a format description file (or files) with format
descriptions for the data files involved before you can use
chkform to chack the format. As with newform, the
standard extension for format description files is .fmt. If you
do not explicitly specify the format description file on the command
line (unnecessary if you use FreeForm ND naming conventions)
chkform follows the FreeForm ND search sequence to find a format
file.
For details about FreeForm ND naming conventions and the search sequence, see Chapter 8.
The chkform command has the following form:
chkforminput_file [-ifinput_format_file] [-ift "title"] [-blocal_buffer_size][
-ccount] [-qquery_file] [-ollog_file] [-elerror_log_file] [-ep]
Most of the arguments are described in
Section 8.6. The following are specific to
chkform:
-ol log_file-el error_log_filechkform.
-epchkform asks you to manually
acknowledge each important error by typing something on the
keyboard. If you use this option, chkform will not stop to
prompt, but will continue processing until either the file is
procesed, or there is an error preventing more processing.
As in the above examples, if you have an ASCII data file called
datafile.dat, supposedly described in a format file called
datafile.fmt, you can use chkform like this:
chkform datafile.dat
If processing is successful, you will see something like the following:
Welcome to Chkform release 4.2.3 -- an NGDC FreeForm ND application (llmaxmin.fmt) ASCII_input_file_header "Latitude/Longitude Limits" File llmaxmin.dat contains 1 header record (71 bytes) Each record contains 6 fields and is 71 characters long. (llmaxmin.fmt) ASCII_input_data "lat/lon" File llmaxmin.dat contains 10 data records (230 bytes) Each record contains 3 fields and is 23 characters long. 100% processed Elapsed time - 00:00:00 No errors found (11 lines checked)