1YAZ-MARCDUMP(1) Commands YAZ-MARCDUMP(1)
2
3
4
6 yaz-marcdump - MARC record dump utility
7
9 yaz-marcdump [-i format] [-o format] [-f from] [-t to] [-l spec]
10 [-c cfile] [-s prefix] [-C size] [-O offset] [-L limit]
11 [-n] [-p] [-v] [-V] [file...]
12
14 yaz-marcdump reads MARC records from one or more files. It parses each
15 record and supports output in line-format, ISO2709, MARCXML[1],
16 MARC-in-JSON[2], MarcXchange[3] as well as Hex output.
17
18 This utility parses records ISO2709(raw MARC), line format,
19 MARC-in-JSON format as well as XML if that is structured as
20 MARCXML/MarcXchange.
21
22 MARC-in-JSON encoding/decoding is supported in YAZ 5.0.5 and later.
23
24 Note
25 As of YAZ 2.1.18, OAI-MARC is no longer supported. OAI-MARC is
26 deprecated. Use MARCXML instead.
27
28 By default, each record is written to standard output in a line format
29 with newline for each field, $x for each sub-field x. The output format
30 may be changed with option -o,
31
32 yaz-marcdump can also be requested to perform character set conversion
33 of each record.
34
36 -i format
37 Specifies input format. Must be one of marcxml, marc (ISO2709),
38 marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo
39 MARC), or json (MARC-in-JSON).
40
41 -o format
42 Specifies output format. Must be one of marcxml, marc (ISO2709),
43 marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo
44 MARC), or json (MARC-in-JSON).
45
46 -f from
47 Specify the character set of the input MARC record. Should be used
48 in conjunction with option -t. Refer to the yaz-iconv man page for
49 supported character sets.
50
51 -t to
52 Specify the character set of the output. Should be used in
53 conjunction with option -f. Refer to the yaz-iconv man page for
54 supported character sets.
55
56 -l leaderspec
57 Specify a simple modification string for MARC leader. The
58 leaderspec is a list of pos=value pairs, where pos is an integer
59 offset (0 - 23) for leader. Value is either a quoted string or an
60 integer (character value in decimal). Pairs are comma separated.
61 For example, to set leader at offset 9 to a, use 9='a'.
62
63 -s prefix
64 Writes a chunk of records to a separate file with prefix given,
65 i.e. splits a record batch into files with only at most "chunk"
66 ISO2709 records per file. By default chunk is 1 (one record per
67 file). See option -C.
68
69 -C chunksize
70 Specifies chunk size; to be used conjunction with option -s.
71
72 -O offset
73 Integer offset for at what position records whould be written.
74 0=first record, 1=second, .. With -L option, this allows a specific
75 range of records to be processed.
76
77 -L limit
78 Integer limit for how many records should at most be written. With
79 -O option, this allows a specific range of records to be processed.
80
81 -p
82 Makes yaz-marcdump print record number and input file offset of
83 each record read.
84
85 -n
86 MARC output is omitted so that MARC input is only checked.
87
88 -v
89 Writes more information about the parsing process. Useful if you
90 have ill-formatted ISO2709 records as input.
91
92 -V
93 Prints YAZ version.
94
96 The following command converts MARC21/USMARC in MARC-8 encoding to
97 MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'. Both
98 input and output records are ISO2709 encoded.
99
100 yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw >marc21.utf8.raw
101
102
103 The same records may be converted to MARCXML instead in UTF-8:
104
105 yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw >marcxml.xml
106
107
108 Turbo MARC is a compact XML notation with same semantics as MARCXML,
109 but which allows for faster processing via XSLT. In order to generate
110 Turbo MARC records encoded in UTF-8 from MARC21 (ISO), one could use:
111
112 yaz-marcdump -f MARC8 -t UTF8 -o turbomarc -i marc marc21.raw >out.xml
113
114
115
117 prefix/bin/yaz-marcdump
118
119 prefix/include/yaz/marcdisp.h
120
122 yaz(7)
123
124 yaz-iconv(1)
125
127 Index Data
128
130 1. MARCXML
131 https://www.loc.gov/standards/marcxml/
132
133 2. MARC-in-JSON
134 https://rossfsinger.com/blog/2010/09/a-proposal-to-serialize-marc-in-json/
135
136 3. MarcXchange
137 https://www.loc.gov/standards/iso25577/
138
139
140
141YAZ 5.32.0 05/30/2022 YAZ-MARCDUMP(1)