[librecat-dev] string operations, defining functions in Catmandu
captsolo at gmail.com
Mon Jul 3 18:49:51 CEST 2017
On 1 July 2017 at 13:58, Patrick Hochstenbach <Patrick.Hochstenbach at ugent.be
> >> 1) Is it possible to also "copy" indicator values (from 100 field)? How
> would you do this?
> >> 2) Is it possible to make a copy of a MARC field (within the record)?
> With Fix you can do anything you want with JSON. A MARC record is just a
> 'record' key in a JSON document which contains an ARRAY of ARRAY values.
> All the fixes copy_field, move_field, etc etc can operate on each type of
> JSON document. A copy of a MARC field could be implemented with something
> # Copy the 100 field to 400
> do list(path:record, var:c)
> if all_match(c.0,100)
This does not quite work - the 100 field gets duplicated (added to the end
of the record) but its type is never changed from 100 to 400.
Any idea how to fix it? - I realise that everything that is necessary can
be done using ARRAY operations but I don't yet know how to correctly write
Also: how would you read the value of the 1st indicator of a certain MARC
- [in this case] it is OK to assume that the field appears in the record
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the librecat-dev