we badly need generic tools for marc manipulations

Par mc, 18 août 2009 9 h 51 min

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:

  1. a MARC mapper in few lines of perl
  2. technique pour splitter les marc records
  3. use vim as package management tool
  4. euler 1 en zsh
  5. Tunnel SSH HTTP

Laisser un commentaire

Panorama Theme by Themocracy