<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='an2k2txt1'>
<!--  @(#)an2k2txt.1 2001/04/02 NIST -->
<!--  I Image Group -->
<!--  Michael D. Garris -->

<refmeta>
<refentrytitle>AN2K2TXT</refentrytitle>
<manvolnum>1C</manvolnum>
<refmiscinfo class='date'>02 April 2001</refmiscinfo>
<refmiscinfo class='source'>NIST</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>an2k2txt</refname>
<refpurpose>Converts an ANSI/NIST 2000 file to a formatted text file.</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>an2k2txt</command>    
    <arg choice='plain'><replaceable>&lt;ansi_nistin&gt;&lt;fmttextout&gt;</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>An2k2txt</emphasis>
parses a standard  compliant ANSI/NIST-ITL 1-2000 file
and writes its contents to a new file in a textually viewable and
editable format.  The contents of binary image fields are stored
to temporary files and externally referenced in the output file.</para>

</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&lt;ansi_nist in&gt;</emphasis></term>
  <listitem>
<para>the ANSI/NIST file to be converted</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;fmttext out&gt;</emphasis></term>
  <listitem>
<para>the output text file</para>

  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='output_format'><title>OUTPUT FORMAT</title>
<para>Every line in the output text represents a single information
item from the ANSI/NIST file.  These lines are formatted as
follows:</para>

<!-- .RS -->
<para><emphasis remap='I'>r.f.s.i </emphasis>[<emphasis remap='I'>t.n</emphasis>]=<emphasis remap='I'>value{US}</emphasis></para>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>r.f.s.i</emphasis></term>
  <listitem>
<para>references the information item with</para>
  <!-- .RS -->
  </listitem>
  </varlistentry>
</variablelist>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>r</emphasis></term>
  <listitem>
<para>the item's positional <emphasis remap='I'>r</emphasis>ecord index in the file</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>f</emphasis></term>
  <listitem>
<para>the item's positional <emphasis remap='I'>f</emphasis>ield index in the record</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>s</emphasis></term>
  <listitem>
<para>the item's positional <emphasis remap='I'>s</emphasis>ubfield index in the field</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>i</emphasis></term>
  <listitem>
<para>the item's positional <emphasis remap='I'>i</emphasis>tem index in the subfield</para>
  </listitem>
  </varlistentry>
</variablelist>

<para>Note that all indices start at 1.</para>
<!-- .RE -->
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>t.n</emphasis></term>
  <listitem>
<para>references the Record Type and Field ID from
the standard.</para>
  <!-- .RS -->
  </listitem>
  </varlistentry>
</variablelist>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>t</emphasis></term>
  <listitem>
<para>the record's <emphasis remap='I'>t</emphasis>ype</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>n</emphasis></term>
  <listitem>
<para>the field's ID <emphasis remap='I'>n</emphasis>umber</para>
  </listitem>
  </varlistentry>
</variablelist>
<!-- .RE -->
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>value</emphasis></term>
  <listitem>
<para>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.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>{US}</emphasis></term>
  <listitem>
<para>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".</para>

  </listitem>
  </varlistentry>
</variablelist>
<!-- .RE -->
<!-- .RE -->
<para><emphasis remap='B'>Example Output Lines</emphasis></para>

<!-- .RS -->
<para>1.5.1.1 [1.005]=19990708&bull;</para>

<para>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 '&bull;' at the end of the line represents the
non-printable {US} character.</para>

<para>1.3.4.1 [1.003]=14&bull;</para>

<para>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.</para>

<para>4.14.1.1 [14.999]=fld_2_14.tmp&bull;</para>

<para>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 output value "fld_2_14.tmp" references an
external filename into which <command>an2k2txt</command> stored the item's binary
data.</para>

</refsect1>

<refsect1 id='examples'><title>EXAMPLES</title>
<para>From <emphasis remap='I'>test/an2k/execs/an2k2txt/an2k2txt.src</emphasis>:</para>

<!-- .RS -->
<para><emphasis remap='B'>% an2k2txt ../../data/nist.an2 nist.fmt</emphasis></para>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para><emphasis remap='B'>an2ktool</emphasis>(1C),
<emphasis remap='B'>txt2an2k</emphasis>(1C)</para>

</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>NIST/ITL/DIV894/Image Group</para>
</refsect1>
</refentry>

