[librecat-dev] Writing values in fixed fields with marc_add

Patrick Hochstenbach Patrick.Hochstenbach at UGent.be
Thu Jun 29 16:30:49 CEST 2017


Hi

marc_set should work:

$ catmandu convert MARC to MARC --type MARCMaker < camel.mrc | grep '=008'
=008  000107s2000\\\\nyua\\\\\\\\\\001\0\eng\\
=008  000203s2000\\\\mau\\\\\\\\\\\001\0\eng\\
=008  000318s1999\\\\cau\\\\\\b\\\\001\0\eng\\
=008  000318s1999\\\\caua\\\\\\\\\\001\0\eng\\
=008  000518s2000\\\\mau\\\\\\\\\\\001\0\eng\\
=008  000612s2000\\\\mau\\\\\\\\\\\100\0\eng\\
=008  000612s2000\\\\mau\\\\\\\\\\\000\0\eng\\
=008  000614s2000\\\\mau\\\\\\\\\\\000\0\eng\\
=008  000315s1999\\\\njua\\\\\\\\\\001\0\eng\\
=008  000630s2000\\\\cau\\\\\\\\\\\001\0\eng\\

$ cat test.fix
set_field(date,1971)
marc_set(008/7-11,$.date)
$ catmandu convert MARC to MARC --type MARCMaker --fix test.fix < camel.mrc | grep '=008'
=008  000107s1971\\\nyua\\\\\\\\\\001\0\eng\\
=008  000203s1971\\\mau\\\\\\\\\\\001\0\eng\\
=008  000318s1971\\\cau\\\\\\b\\\\001\0\eng\\
=008  000318s1971\\\caua\\\\\\\\\\001\0\eng\\
=008  000518s1971\\\mau\\\\\\\\\\\001\0\eng\\
=008  000612s1971\\\mau\\\\\\\\\\\100\0\eng\\
=008  000612s1971\\\mau\\\\\\\\\\\000\0\eng\\
=008  000614s1971\\\mau\\\\\\\\\\\000\0\eng\\
=008  000315s1971\\\njua\\\\\\\\\\001\0\eng\\
=008  000630s1971\\\cau\\\\\\\\\\\001\0\eng\\

I use Catmandu::MARC 1.14 for this.

I’m preparing now a Catmandu::MARC 1.15 for a new release which will give you marc_append(MARC_PATH,VALUE) and marc_replace_all(MARC_PATH,REGEX,VALUE)

Cheers
Patrick

> On 29 Jun 2017, at 15:26, Schihin Oliver <Oliver.Schihin at zhbluzern.ch> wrote:
> 
> marc_set(‘008/7-11’, $.date)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20170629/b7e8e167/attachment.asc>


More information about the librecat-dev mailing list