80950988c3e4136eb5b15dcf0293e10283eecdeb
[yaz-moved-to-github.git] / doc / yaz-marcdump-man.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
2  "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % idcommon SYSTEM "common/common.ent">
9      %idcommon;
10 ]>
11 <refentry id="yaz-marcdump">
12  <refentryinfo>
13   <productname>YAZ</productname>
14   <productnumber>&version;</productnumber>
15  </refentryinfo>
16  <refmeta>
17   <refentrytitle>yaz-marcdump</refentrytitle>
18   <manvolnum>1</manvolnum>
19  </refmeta>
20  
21  <refnamediv>
22   <refname>yaz-marcdump</refname>
23   <refpurpose>MARC record dump utility</refpurpose>
24  </refnamediv>
25  
26  <refsynopsisdiv>
27   <cmdsynopsis>
28    <command>yaz-marcdump</command>
29    <arg choice="opt"><option>-i <replaceable>format</replaceable></option></arg>
30    <arg choice="opt"><option>-o <replaceable>format</replaceable></option></arg>
31    <arg choice="opt"><option>-f <replaceable>from</replaceable></option></arg>
32    <arg choice="opt"><option>-t <replaceable>to</replaceable></option></arg>
33    <arg choice="opt"><option>-l <replaceable>spec</replaceable></option></arg>
34    <arg choice="opt"><option>-v</option></arg>
35    <arg choice="opt"><option>-c <replaceable>cfile</replaceable></option></arg>
36    <arg choice="opt"><option>-s <replaceable>prefix</replaceable></option></arg>
37    <arg choice="opt"><option>-C <replaceable>size</replaceable></option></arg>
38    <arg choice="opt"><option>-p</option></arg>
39    <arg choice="opt" rep="repeat">file</arg>
40   </cmdsynopsis>
41  </refsynopsisdiv>
42  
43  <refsect1><title>DESCRIPTION</title>
44   <para>
45    <command>yaz-marcdump</command> reads MARC records from one or
46    more files.
47    It parses each record and supports output in line-format, 
48    ISO2709, MARCXML, MarcXchange as well as Hex output.
49   </para>
50   <para>
51    This utility parses records ISO2709(raw MARC) as well as XML
52    if that is structured as MARCXML/MarcXchange.
53   </para>
54   <note>
55    <para>
56     As of YAZ 2.1.18, OAI-MARC is no longer supported.
57     OAI-MARC is deprecated. Use MARCXML instead.
58    </para>
59   </note>
60   <para>
61    By default, each record is written to standard output in a line
62    format with newline for each field, $x for each subfield x.
63    The output format may be changed with option <literal>-o</literal>,
64   </para>
65   <para>
66    <command>yaz-marcdump</command> can also be requested to perform
67    character set conversion of each record.
68   </para>
69  </refsect1>
70  
71  <refsect1><title>OPTIONS</title>
72   
73   <variablelist>
74    <varlistentry>
75     <term>-i <replaceable>format</replaceable></term>
76     <listitem><para>
77       Specifies input format. Must be one of
78       <literal>marcxml</literal>, <literal>marc</literal> (ISO2709),
79       <literal>marcxchange</literal> (ISO25577),
80       <literal>line</literal> (line mode MARC).
81      </para></listitem>
82    </varlistentry>
83
84    <varlistentry>
85     <term>-o <replaceable>format</replaceable></term>
86     <listitem><para>
87       Specifies output format. Must be one of
88       <literal>marcxml</literal>, <literal>marc</literal> (ISO2709),
89       <literal>marcxchange</literal> (ISO25577),
90       <literal>line</literal> (line mode MARC).
91      </para></listitem>
92    </varlistentry>
93
94    <varlistentry>
95     <term>-f <replaceable>from</replaceable></term>
96     <listitem><para>
97       Specify the character set <replaceable>from</replaceable>
98       of the input MARC record.
99       Should be used in conjunction with option <literal>-t</literal>.
100      </para></listitem>
101    </varlistentry>
102
103    <varlistentry>
104     <term>-t <replaceable>to</replaceable></term>
105     <listitem><para>
106       Specify the character set <replaceable>of</replaceable>
107       of the output.
108       Should be used in conjunction with option <literal>-f</literal>.
109      </para></listitem>
110    </varlistentry>
111
112    <varlistentry>
113     <term>-l <replaceable>leaderspec</replaceable></term>
114     <listitem><para>
115       Specify a simple modification string for MARC leader. The
116       <replaceable>leaderspec</replaceable> is a list of pos=value
117       pairs, where pos is an integer offset (0 - 23) for leader. Value
118       is either a quoted string or an integer (character value in decimal).
119       Pairs are comma separated. For example, to set leader at offset 9
120       to a, use <literal>9=a</literal>.
121      </para></listitem>
122    </varlistentry>
123
124    <varlistentry>
125     <term>-v</term>
126     <listitem><para>
127       Writes more information about the parsing process.
128       Useful if you have ill-formatted ISO2709 records as input.
129      </para></listitem>
130    </varlistentry>
131
132    <varlistentry>
133     <term>-s <replaceable>prefix</replaceable></term>
134     <listitem><para>
135       Writes a chunk of records to a separate file with prefix given,
136       i.e. splits a record batch into files with only at most
137       "chunk" ISO2709 record per file. By default chunk is 1 (one record
138       per file). See option <literal>-C</literal>.
139      </para></listitem>
140    </varlistentry>
141
142    <varlistentry>
143     <term>-C <replaceable>chunksize</replaceable></term>
144     <listitem><para>
145       Specifies chunk size; to be used conjunction with option 
146       <literal>-s</literal>.
147      </para></listitem>
148    </varlistentry>
149
150    <varlistentry>
151     <term>-p</term>
152     <listitem><para>
153       Makes yaz-marcdump prints record number and input file offset
154       of each record read.
155      </para></listitem>
156    </varlistentry>
157
158   </variablelist>
159  </refsect1>
160
161  <refsect1><title>EXAMPLES</title>
162   <para>
163    The following command converts MARC21/USMARC in MARC-8 encoding to
164    MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'.
165    Both input and output records are ISO2709 encoded.
166    <screen>
167     yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw >marc21.utf8.raw
168    </screen>
169   </para>
170   <para>
171    The same records may be converted to MARCXML instead in UTF-8:
172    <screen>
173     yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw >marcxml.xml
174    </screen>
175   </para>
176  </refsect1> 
177
178  <refsect1><title>FILES</title>
179   <para>
180    <filename><replaceable>prefix</replaceable>/bin/yaz-marcdump</filename>
181   </para>
182   <para>
183    <filename><replaceable>prefix</replaceable>/include/yaz/marcdisp.h</filename>
184   </para>
185   </refsect1>
186  <refsect1><title>SEE ALSO</title>
187   <para>
188    yaz(7)
189   </para>
190  </refsect1>
191 </refentry>
192
193 <!-- Keep this comment at the end of the file
194 Local variables:
195 mode: sgml
196 sgml-omittag:t
197 sgml-shorttag:t
198 sgml-minimize-attributes:nil
199 sgml-always-quote-attributes:t
200 sgml-indent-step:1
201 sgml-indent-data:t
202 sgml-parent-document:nil
203 sgml-local-catalogs: nil
204 sgml-namecase-general:t
205 End:
206 -->