TXT2AN2K

Name

txt2an2k -- Converts a formatted text file into an ANSI/NIST 2000 file.

Synopsis

txt2an2k <fmttextin><ansi_nistout>

DESCRIPTION

Txt2an2k parses a specially formatted text file representing the contents of an ANSI/NIST-ITL 1-2000 file, and writes its contents to a new file in the standard compliant format. This utility when used in conjunction with an2k2txt enables changes to be interactively made to an ANSI/NIST file using a simple text editor.

OPTIONS

<fmttext in>

the formatted text file to be converted

<ansi_nist out>

the output ANSI/NIST file

INPUT FORMAT

Every line in the input text represents a single information item for the ANSI/NIST file. These lines are formatted as follows:

r.f.s.i [t.n]=value{US}

r.f.s.i

references the information item with

r

the item's positional record index in the file

f

the item's positional field index in the record

s

the item's positional subfield index in the field

i

the item's positional item index in the subfield

Note that all indices start at 1.

t.n

references the Record Type and Field ID from the standard.

t

the record's type

n

the field's ID number

value

is the textual content of the information item, unless the information item contains binary image data, in which case, the value is the name of an external file containing the binary data.

{US}

is the non-printable ASCII character 0x1F. This separator character is one of 4 used in the standard. In VIM, this non-printable character may be entered using the ^v command and entering the decimal code "31". In Emacs, this non-printable character may be entered using the ^q command and entering the octal code "037".

Example Input Lines

1.5.1.1 [1.005]=19990708•

This is the information item corresponding to the Date (DAT) field in the standard. It is the 5th field in a Type-1 record, and the Type-1 record is always the first record in the ANSI/NIST file; therefore, its record index is 1, its field index is 5, its subfield index is 1, and its item index is 1. The value of this information item represents the date of July 8, 1999. The '•' at the end of the line represents the non-printable {US} character.

1.3.4.1 [1.003]=14•

This information item is part of the File Content (CNT) field. The CNT field is the 3rd field in a Type-1 record, so this information item's record index is 1 and its field index is 3. This information item is in the 4th subfield of the CNT field, and has an item index of 1; therefore, its value 14 signifies that the 4th record (the subfield index) in this ANSI/NIST file is a Type-14 record.

4.14.1.1 [14.999]=fld_2_14.tmp•

This information item corresponds to an Image Data field of a Type-14 record. This field always has numeric ID 999 and is always the last field in the image record. This Type-14 record is the 4th record in this ANSI/NIST file, so the Image Data information item has record index 4, and it is in the 14th field (field index 14) in the record. This information item in the ANSI/NIST file contains binary pixel data, so the input value "fld_2_14.tmp" references an external filename from which txt2an2k reads the item's binary data.

EXAMPLES

From test/an2k/execs/txt2an2k/txt2an2k.src:

% txt2an2k ../an2k2txt/nist.fmt nist.an2

SEE ALSO

an2k2txt(1C), an2ktool(1C)

AUTHOR

NIST/ITL/DIV894/Image Group