Fix windows uninstall does not remove start menu shortcuts YAZ-860
[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,
54    <ulink url="&url.marcxml;">MARCXML</ulink>,
55    <ulink url="&url.marc_in_json;">MARC-in-JSON</ulink>,
56    <ulink url="&url.marcxchange;">MarcXchange</ulink>
57    as well as Hex output.
58   </para>
59   <para>
60    This utility parses records ISO2709(raw MARC), line format, MARC-in-JSON
61    format as well as XML if that is structured as MARCXML/MarcXchange.
62   </para>
63   <para>
64    MARC-in-JSON encoding/decoding is supported in YAZ 5.0.5 and later.
65   </para>
66   <note>
67    <para>
68     As of YAZ 2.1.18, OAI-MARC is no longer supported.
69     OAI-MARC is deprecated. Use MARCXML instead.
70    </para>
71   </note>
72   <para>
73    By default, each record is written to standard output in a line
74    format with newline for each field, $x for each subfield x.
75    The output format may be changed with option <literal>-o</literal>,
76   </para>
77   <para>
78    <command>yaz-marcdump</command> can also be requested to perform
79    character set conversion of each record.
80   </para>
81  </refsect1>
82
83  <refsect1><title>OPTIONS</title>
84
85   <variablelist>
86    <varlistentry>
87     <term>-i <replaceable>format</replaceable></term>
88     <listitem><para>
89       Specifies input format. Must be one of
90       <literal>marcxml</literal>, <literal>marc</literal> (ISO2709),
91       <literal>marcxchange</literal> (ISO25577),
92       <literal>line</literal> (line mode MARC),
93       <literal>turbomarc</literal> (Turbo MARC),
94       or <literal>json</literal> (MARC-in-JSON).
95      </para></listitem>
96    </varlistentry>
97
98    <varlistentry>
99     <term>-o <replaceable>format</replaceable></term>
100     <listitem><para>
101       Specifies output format. Must be one of
102       <literal>marcxml</literal>, <literal>marc</literal> (ISO2709),
103       <literal>marcxchange</literal> (ISO25577),
104       <literal>line</literal> (line mode MARC),
105       <literal>turbomarc</literal> (Turbo MARC),
106       or <literal>json</literal> (MARC-in-JSON).
107      </para></listitem>
108    </varlistentry>
109
110    <varlistentry>
111     <term>-f <replaceable>from</replaceable></term>
112     <listitem><para>
113       Specify the character set <replaceable>from</replaceable>
114       of the input MARC record.
115       Should be used in conjunction with option <literal>-t</literal>.
116       Refer to the yaz-iconv man page for supported character sets.
117      </para></listitem>
118    </varlistentry>
119
120    <varlistentry>
121     <term>-t <replaceable>to</replaceable></term>
122     <listitem><para>
123       Specify the character set <replaceable>of</replaceable>
124       of the output.
125       Should be used in conjunction with option <literal>-f</literal>.
126       Refer to the yaz-iconv man page for supported character sets.
127      </para></listitem>
128    </varlistentry>
129
130    <varlistentry>
131     <term>-l <replaceable>leaderspec</replaceable></term>
132     <listitem><para>
133       Specify a simple modification string for MARC leader. The
134       <replaceable>leaderspec</replaceable> is a list of pos=value
135       pairs, where pos is an integer offset (0 - 23) for leader. Value
136       is either a quoted string or an integer (character value in decimal).
137       Pairs are comma separated. For example, to set leader at offset 9
138       to a, use <literal>9='a'</literal>.
139      </para></listitem>
140    </varlistentry>
141
142    <varlistentry>
143     <term>-s <replaceable>prefix</replaceable></term>
144     <listitem><para>
145       Writes a chunk of records to a separate file with prefix given,
146       i.e. splits a record batch into files with only at most
147       "chunk" ISO2709 record per file. By default chunk is 1 (one record
148       per file). See option <literal>-C</literal>.
149      </para></listitem>
150    </varlistentry>
151
152    <varlistentry>
153     <term>-C <replaceable>chunksize</replaceable></term>
154     <listitem><para>
155       Specifies chunk size; to be used conjunction with option
156       <literal>-s</literal>.
157      </para></listitem>
158    </varlistentry>
159
160    <varlistentry>
161     <term>-p</term>
162     <listitem><para>
163       Makes yaz-marcdump prints record number and input file offset
164       of each record read.
165      </para></listitem>
166    </varlistentry>
167
168    <varlistentry>
169     <term>-n</term>
170     <listitem><para>
171       MARC output is omitted so that MARC input is only checkecd.
172      </para></listitem>
173    </varlistentry>
174
175    <varlistentry>
176     <term>-v</term>
177     <listitem><para>
178       Writes more information about the parsing process.
179       Useful if you have ill-formatted ISO2709 records as input.
180      </para></listitem>
181    </varlistentry>
182
183    <varlistentry>
184     <term>-V</term>
185     <listitem><para>
186       Prints YAZ version.
187      </para></listitem>
188    </varlistentry>
189
190   </variablelist>
191  </refsect1>
192
193  <refsect1><title>EXAMPLES</title>
194   <para>
195    The following command converts MARC21/USMARC in MARC-8 encoding to
196    MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'.
197    Both input and output records are ISO2709 encoded.
198    <screen>
199     yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw >marc21.utf8.raw
200    </screen>
201   </para>
202   <para>
203    The same records may be converted to MARCXML instead in UTF-8:
204    <screen>
205     yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw >marcxml.xml
206    </screen>
207   </para>
208
209   <para>
210    Turbo MARC is a compact XML notation with same semantics as
211    MARCXML, but which allows for faster processing via XSLT. In order
212    to generate Turbo MARC records encoded in UTF-8 from MARC21 (ISO), one
213    could use:
214    <screen>
215     yaz-marcdump -f MARC8 -t UTF8 -o turbomarc -i marc marc21.raw >out.xml
216    </screen>
217   </para>
218  </refsect1>
219
220  <refsect1><title>FILES</title>
221   <para>
222    <filename><replaceable>prefix</replaceable>/bin/yaz-marcdump</filename>
223   </para>
224   <para>
225    <filename><replaceable>prefix</replaceable>/include/yaz/marcdisp.h</filename>
226   </para>
227   </refsect1>
228  <refsect1><title>SEE ALSO</title>
229   <para>
230    <citerefentry>
231     <refentrytitle>yaz</refentrytitle>
232     <manvolnum>7</manvolnum>
233    </citerefentry>
234   </para>
235   <para>
236    <citerefentry>
237     <refentrytitle>yaz-iconv</refentrytitle>
238     <manvolnum>1</manvolnum>
239    </citerefentry>
240   </para>
241  </refsect1>
242 </refentry>
243
244 <!-- Keep this comment at the end of the file
245 Local variables:
246 mode: nxml
247 nxml-child-indent: 1
248 End:
249 -->