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