AN2KTOOL

Name

an2ktool -- Parses, manipulates, and/or writes the results to an ANSI/NIST 2000 file in batch mode.

Synopsis

an2ktool <option>
-print <all | r | .f [.s.[i]]> | <filein> | fileout
| -delete r | .f [.s.[i]] | <filein> | fileout
| -substitute r.f.s.i | <newvalue><filein> | fileout
| -substitute r | .f.[s] | <fmttextfile><filein> | fileout
| -insert r.f.s.i | <newvalue><filein> | fileout
| -insert r | .f.[s] | <fmttextfile><filein> | fileout

DESCRIPTION

An2ktool parses a standard compliant ANSI/NIST-ITL 1-2000 file, manipulates its contents, and writes the results back out. Batch operations may be conducted at the level of record, field, subfield, or information item. Possible operations include printing, deleting, substituting, or inserting data.

OPTIONS

All switch names may be abbreviated; for example, -print may be written -p.

PRINT OPTION

-print <all|r[.f[.s[.i]]]> <file in> [file out]

Prints the contents of the specified structure {file, record, field, subfield, or information item} to either the specified output file or to standard output.

Option settings:

all

The entire contents of the input file is printed. Any binary image fields in the file are stored to temporary files, and their file names are externally referenced in the printed output. This option setting is equivalent to running an2k2txt on the input file.

r

The contents of the record at position r in the file is printed.

r.f

The contents of the field at position f within record r is printed.

r.f.s

The contents of the subfield at position s within field f within record r is printed.

r.f.s.i

The contents of the information item at position i within subfield s within field f within record r is printed.

<file in>

The ANSI/NIST file whose content is to be printed.

[file out]

The optional output file. If omitted, results are printed to standard output.

DELETE OPTION

-delete r[.f[.s[.i]]] <file in> [file out]

Deletes the contents of the specified structure {record, field, subfield, or information item} from the ANSI/NIST file, writing the results to either the specified output file or to standard output.

Option settings:

r

The contents of the record at position r in the file is deleted.

r.f

The contents of the field at position f within record r is deleted.

r.f.s

The contents of the subfield at position s within field f within record r is deleted.

r.f.s.i

The contents of the information item at position i within subfield s within field f within record r is deleted.

<file in>

The ANSI/NIST file whose content is to be modified.

[file out]

The optional output file. If omitted, results are printed to standard output.

SUBSTITUTE OPTION 1

-substitute r.f.s.i <new value> <file in> [file out]

Substitutes the contents of the specified information item in an ANSI/NIST file with the string value provided on the command line, writing the results to either the specified output file or to standard output.

r.f.s.i

The position indices of the information item to be substituted.

<new value>

The new string value.

<file in>

The ANSI/NIST file whose content is to be modified.

[file out]

The optional output file. If omitted, results are printed to standard output.

SUBSTITUTE OPTION 2

-substitute r[.f[.s]] <fmttext file> <file in> [file out]

Substitutes the contents of the specified structure {record, field, or subfield} in an ANSI/NIST file with the contents of a formatted text file consistent in format to those produced by an2k2txt. The results are written to either the specified output file or to standard output.

Option settings:

r

The contents of the record at position r in the file is substituted.

r.f

The contents of the field at position f within record r is substituted.

r.f.s

The contents of the subfield at position s within field f within record r is substituted.

r.f.s.i

The contents of the information item at position i within subfield s within field f within record r is substituted.

<fmttext file>

The formatted text file containing the new values.

<file in>

The ANSI/NIST file whose content is to be modified.

[file out]

The optional output file. If omitted, results are printed to standard output.

INSERT OPTION 1

-insert r.f.s.i <new value> <file in> [file out]

Inserts an information item at the specified position within an ANSI/NIST file, assigning the new item the string value provided on the command line. The results are written to either the specified output file or to standard output.

r.f.s.i

The position indices where the new information item is to be inserted.

<new value>

The new information item's string value.

<file in>

The ANSI/NIST file whose content is to be modified.

[file out]

The optional output file. If omitted, results are printed to standard output.

INSERT OPTION 2

-insert r[.f[.s]] <fmttext file> <file in> [file out]

Inserts a structure {record, field, or subfield} at the specified position within an ANSI/NIST file. The new structure is assigned the contents of a formatted text file consistent in format to those produced by an2k2txt. The results are written to either the specified output file or to standard output.

Option settings:

r

A record at position r is inserted.

r.f

A field at position f within record r is inserted.

r.f.s

A subfield at position s within field f within record r is inserted.

r.f.s.i

An information item at position i within subfield s within field f within record r is inserted.

<fmttext file>

The formatted text file containing the new values.

<file in>

The ANSI/NIST file whose content is to be modified.

[file out]

The optional output file. If omitted, results are printed to standard output.

EXAMPLES

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

% an2ktool -d 2.12.1.4 ../../data/nist.an2 delete.an2 deletes the information item recording the first minutia's type.

% an2ktool -i 2.12.1.4 A delete.an2 insert.an2 inserts an information item setting the first minutia's type to "A".

% an2ktool -s 2.12.1.4 A ../../data/nist.an2 subitem.an2 replaces the information item recording the first minutia's type with the value "A".

% an2ktool -s 2.12.1 subfld.fmt ../../data/nist.an2 subfld.an2 replaces the subfield containing all the attributes related to the first minutia with the contents of the formatted text file subfld.fmt.

SEE ALSO

an2k2iaf(1C), an2k2txt(1C), dpyan2k(1C), iaf2an2k(1C), txt2an2k(1C)

AUTHOR

NIST/ITL/DIV894/Image Group