Fix change in source repo
[yaz-moved-to-github.git] / doc / yaz-marcdump-man.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2  "http://www.oasis-open.org/docbook/xml/4.4/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   <info><orgname>Index Data</orgname></info>
16  </refentryinfo>
17
18  <refmeta>
19   <refentrytitle>yaz-marcdump</refentrytitle>
20   <manvolnum>1</manvolnum>
21   <refmiscinfo class="manual">Commands</refmiscinfo>
22  </refmeta>
23
24  <refnamediv>
25   <refname>yaz-marcdump</refname>
26   <refpurpose>MARC record dump utility</refpurpose>
27  </refnamediv>
28
29  <refsynopsisdiv>
30   <cmdsynopsis>
31    <command>yaz-marcdump</command>
32    <arg choice="opt"><option>-i <replaceable>format</replaceable></option></arg>
33    <arg choice="opt"><option>-o <replaceable>format</replaceable></option></arg>
34    <arg choice="opt"><option>-f <replaceable>from</replaceable></option></arg>
35    <arg choice="opt"><option>-t <replaceable>to</replaceable></option></arg>
36    <arg choice="opt"><option>-l <replaceable>spec</replaceable></option></arg>
37    <arg choice="opt"><option>-c <replaceable>cfile</replaceable></option></arg>
38    <arg choice="opt"><option>-s <replaceable>prefix</replaceable></option></arg>
39    <arg choice="opt"><option>-C <replaceable>size</replaceable></option></arg>
40    <arg choice="opt"><option>-n</option></arg>
41    <arg choice="opt"><option>-p</option></arg>
42    <arg choice="opt"><option>-v</option></arg>
43    <arg choice="opt"><option>-V</option></arg>
44    <arg choice="opt" rep="repeat">file</arg>
45   </cmdsynopsis>
46  </refsynopsisdiv>
47
48  <refsect1><title>DESCRIPTION</title>
49   <para>
50    <command>yaz-marcdump</command> reads MARC records from one or
51    more files.
52    It parses each record and supports output in line-format,
53    ISO2709, MARCXML, MarcXchange as well as Hex output.
54   </para>
55   <para>
56    This utility parses records ISO2709(raw MARC) as well as XML
57    if that is structured as MARCXML/MarcXchange.
58   </para>
59   <note>
60    <para>
61     As of YAZ 2.1.18, OAI-MARC is no longer supported.
62     OAI-MARC is deprecated. Use MARCXML instead.
63    </para>
64   </note>
65   <para>
66    By default, each record is written to standard output in a line
67    format with newline for each field, $x for each subfield x.
68    The output format may be changed with option <literal>-o</literal>,
69   </para>
70   <para>
71    <command>yaz-marcdump</command> can also be requested to perform
72    character set conversion of each record.
73   </para>
74  </refsect1>
75
76  <refsect1><title>OPTIONS</title>
77
78   <variablelist>
79    <varlistentry>
80     <term>-i <replaceable>format</replaceable></term>
81     <listitem><para>
82       Specifies input format. Must be one of
83       <literal>marcxml</literal>, <literal>marc</literal> (ISO2709),
84       <literal>marcxchange</literal> (ISO25577),
85       <literal>line</literal> (line mode MARC),
86       or <literal>turbomarc</literal> (Turbo MARC).
87      </para></listitem>
88    </varlistentry>
89
90    <varlistentry>
91     <term>-o <replaceable>format</replaceable></term>
92     <listitem><para>
93       Specifies output format. Must be one of
94       <literal>marcxml</literal>, <literal>marc</literal> (ISO2709),
95       <literal>marcxchange</literal> (ISO25577),
96       <literal>line</literal> (line mode MARC),
97       or <literal>turbomarc</literal> (Turbo MARC).
98      </para></listitem>
99    </varlistentry>
100
101    <varlistentry>
102     <term>-f <replaceable>from</replaceable></term>
103     <listitem><para>
104       Specify the character set <replaceable>from</replaceable>
105       of the input MARC record.
106       Should be used in conjunction with option <literal>-t</literal>.
107       Refer to the yaz-iconv man page for supported character sets.
108      </para></listitem>
109    </varlistentry>
110
111    <varlistentry>
112     <term>-t <replaceable>to</replaceable></term>
113     <listitem><para>
114       Specify the character set <replaceable>of</replaceable>
115       of the output.
116       Should be used in conjunction with option <literal>-f</literal>.
117       Refer to the yaz-iconv man page for supported character sets.
118      </para></listitem>
119    </varlistentry>
120
121    <varlistentry>
122     <term>-l <replaceable>leaderspec</replaceable></term>
123     <listitem><para>
124       Specify a simple modification string for MARC leader. The
125       <replaceable>leaderspec</replaceable> is a list of pos=value
126       pairs, where pos is an integer offset (0 - 23) for leader. Value
127       is either a quoted string or an integer (character value in decimal).
128       Pairs are comma separated. For example, to set leader at offset 9
129       to a, use <literal>9='a'</literal>.
130      </para></listitem>
131    </varlistentry>
132
133    <varlistentry>
134     <term>-s <replaceable>prefix</replaceable></term>
135     <listitem><para>
136       Writes a chunk of records to a separate file with prefix given,
137       i.e. splits a record batch into files with only at most
138       "chunk" ISO2709 record per file. By default chunk is 1 (one record
139       per file). See option <literal>-C</literal>.
140      </para></listitem>
141    </varlistentry>
142
143    <varlistentry>
144     <term>-C <replaceable>chunksize</replaceable></term>
145     <listitem><para>
146       Specifies chunk size; to be used conjunction with option
147       <literal>-s</literal>.
148      </para></listitem>
149    </varlistentry>
150
151    <varlistentry>
152     <term>-p</term>
153     <listitem><para>
154       Makes yaz-marcdump prints record number and input file offset
155       of each record read.
156      </para></listitem>
157    </varlistentry>
158
159    <varlistentry>
160     <term>-n</term>
161     <listitem><para>
162       MARC output is omitted so that MARC input is only checkecd.
163      </para></listitem>
164    </varlistentry>
165
166    <varlistentry>
167     <term>-v</term>
168     <listitem><para>
169       Writes more information about the parsing process.
170       Useful if you have ill-formatted ISO2709 records as input.
171      </para></listitem>
172    </varlistentry>
173
174    <varlistentry>
175     <term>-V</term>
176     <listitem><para>
177       Prints YAZ version.
178      </para></listitem>
179    </varlistentry>
180
181   </variablelist>
182  </refsect1>
183
184  <refsect1><title>EXAMPLES</title>
185   <para>
186    The following command converts MARC21/USMARC in MARC-8 encoding to
187    MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'.
188    Both input and output records are ISO2709 encoded.
189    <screen>
190     yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw >marc21.utf8.raw
191    </screen>
192   </para>
193   <para>
194    The same records may be converted to MARCXML instead in UTF-8:
195    <screen>
196     yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw >marcxml.xml
197    </screen>
198   </para>
199
200   <para>
201    Turbo MARC is a compact XML notation with same semantics as
202    MARCXML, but which allows for faster processing via XSLT. In order
203    to generate Turbo MARC records encoded in UTF-8 from MARC21 (ISO), one
204    could use:
205    <screen>
206     yaz-marcdump -f MARC8 -t UTF8 -o turbomarc -i marc marc21.raw >out.xml
207    </screen>
208   </para>
209  </refsect1>
210
211  <refsect1><title>FILES</title>
212   <para>
213    <filename><replaceable>prefix</replaceable>/bin/yaz-marcdump</filename>
214   </para>
215   <para>
216    <filename><replaceable>prefix</replaceable>/include/yaz/marcdisp.h</filename>
217   </para>
218   </refsect1>
219  <refsect1><title>SEE ALSO</title>
220   <para>
221    <citerefentry>
222     <refentrytitle>yaz</refentrytitle>
223     <manvolnum>7</manvolnum>
224    </citerefentry>
225   </para>
226   <para>
227    <citerefentry>
228     <refentrytitle>yaz-iconv</refentrytitle>
229     <manvolnum>1</manvolnum>
230    </citerefentry>
231   </para>
232   <para>
233    <ulink url="&url.marcxml;">MARCXML</ulink>.
234   </para>
235   <para>
236    <ulink url="&url.marcxchange;">ISO25577</ulink>.
237   </para>
238  </refsect1>
239 </refentry>
240
241 <!-- Keep this comment at the end of the file
242 Local variables:
243 mode: sgml
244 sgml-omittag:t
245 sgml-shorttag:t
246 sgml-minimize-attributes:nil
247 sgml-always-quote-attributes:t
248 sgml-indent-step:1
249 sgml-indent-data:t
250 sgml-parent-document:nil
251 sgml-local-catalogs: nil
252 sgml-namecase-general:t
253 End:
254 -->