Format files are ASCII files with an extension .fmt, used optionally by the commands CREATE/TABLE, READ/TABLE and PRINT/TABLE to control the input/output conversion. They may contain first a FS statement, they must contain then one DEFINE/FIELD statement for each column of the table and optional comment statements. DEFINE/FIELD statements follow the syntax:
/FIELD pos1 pos2 type [format] label [unit]where:
The statement FS defines the list of field separators used in
the ASCII data file. It is only used when pos1 and pos2 are not
specified in the DEFINE/FIELD statement. This statement should be written
as follows: FS = "f1f2f3". The number of field separators is not
limited. If the blank is used as field separator and if the ascii data
file contains character strings, the strings have to be enclosed by
double quotes. Per default,
FS = "t", i.e TABS and blanks
are used as field separators.
The following format file
!+corresponds to an ASCII file, test1.dat say, with the following record structure:
! Example format file test1.fmt
!+
DEFINE/FIELD 1 9 C :NAME "NGC"
DEFINE/FIELD 10 14 R F5.2 :RA "HOUR"
DEFINE/FIELD 16 20 R F5.2 :DEC "DEGREE"
DEFINE/FIELD 22 22 C :TYPE " "
DEFINE/FIELD 24 26 I :RV "KM.SEC-1"
END
.........1.........2.........3(The ruler, of course, is not part of the data file.)
123456789012345678901234567890
NGC 3379 10.75 12.85 E 893
The following format file, using FS statement,
!+can be used to create a table from the ASCII file test2.dat
! Example format file test2.fmt
!+
FS = "" DEFINE/FIELD C :NAME "NGC"
DEFINE/FIELD R F5.2 :RA "HOUR"
DEFINE/FIELD R F5.2 :DEC "DEGREE"
DEFINE/FIELD C :TYPE " "
DEFINE/FIELD I :RV "KM.SEC-1"
END
3379<TAB>10.75<TAB>12.85<TAB>E<TAB>893