we badly need generic tools for marc manipulations
hdl sent this link to me: a tool that make basic translations between marc fields (as copy, move, …). It reminds me my attempt to write a marcawk in which i tied MARC records in hashes.
the ed summer’s tool is very easy to use:
subjmap --translate=650ab
in marawk:
marawk -each '
@{$_{650}{qw<a b>}} = @{$_{650}{qw<b a>}};
print $_->as_usmarc;
'in counterpart: my tool is more powerfull. The ultimate goal was to write
those kind of code to generate html reports
marawk -MCGI=:standard \
-begin 'print start_html("book list"), start_table;'
-each 'print Tr( map td($_)
, $_{210}{a} . $_{210}{b}
, $_{200}{a}
)'
-end 'print end_table, end_html;'
'everything works but the automatic tie of subfields as hash
(i just had no time to investigate). It can be worked around easily with my
recent MARC::Mapper: it’s easy to patch marawk to write:
marawk -as unimarc -MCGI=:standard \
-begin 'print start_html("book list"), start_table;'
-each 'print Tr( map td($_)
, $_->title
, $_->author
)'
-end 'print end_table, end_html;'Related posts: