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
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.
-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:
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.
The contents of the record at position r in the file is printed.
The contents of the field at position f within record r is printed.
The contents of the subfield at position s within field f within record r is printed.
The contents of the information item at position i within subfield s within field f within record r is printed.
The ANSI/NIST file whose content is to be printed.
The optional output file. If omitted, results are printed to standard output.
-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:
The contents of the record at position r in the file is deleted.
The contents of the field at position f within record r is deleted.
The contents of the subfield at position s within field f within record r is deleted.
The contents of the information item at position i within subfield s within field f within record r is deleted.
The ANSI/NIST file whose content is to be modified.
The optional output file. If omitted, results are printed to standard output.
-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.
The position indices of the information item to be substituted.
The new string value.
The ANSI/NIST file whose content is to be modified.
The optional output file. If omitted, results are printed to standard output.
-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:
The contents of the record at position r in the file is substituted.
The contents of the field at position f within record r is substituted.
The contents of the subfield at position s within field f within record r is substituted.
The contents of the information item at position i within subfield s within field f within record r is substituted.
The formatted text file containing the new values.
The ANSI/NIST file whose content is to be modified.
The optional output file. If omitted, results are printed to standard output.
-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.
The position indices where the new information item is to be inserted.
The new information item's string value.
The ANSI/NIST file whose content is to be modified.
The optional output file. If omitted, results are printed to standard output.
-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:
A record at position r is inserted.
A field at position f within record r is inserted.
A subfield at position s within field f within record r is inserted.
An information item at position i within subfield s within field f within record r is inserted.
The formatted text file containing the new values.
The ANSI/NIST file whose content is to be modified.
The optional output file. If omitted, results are printed to standard output.
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.