<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 1 July 2017 at 13:58, Patrick Hochstenbach <span dir="ltr"><<a href="mailto:Patrick.Hochstenbach@ugent.be" target="_blank">Patrick.Hochstenbach@ugent.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<div style="color:rgb(33,33,33)">
<div>
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote"><span class=""><br>
<div><span style="font-size:12pt">>> 1) Is it possible to also "copy" indicator values (from 100 field)? How would you do this?</span><br>
</div>
</span><span class=""><div><span style="font-size:12pt">>> 2) Is it possible to make a copy of a MARC field (within the record)?</span><br>
</div>
</span><div><br>
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 like:<br>
</div>
<div><br>
</div>
<div>
<div># Copy the 100 field to 400</div>
<div>do list(path:record, var:c)</div>
<div>  if all_match(c.0,100)</div>
<div>   copy_field(c,copy.$append)</div>
<div>   replace_all(copy.$end.0,100,<wbr>400)</div>
<div>  end</div>
<div>end</div>
<div><br>
</div>
<div>move_field(copy.*,record.$<wbr>append)<br>
</div>
<div>remove_field(copy)<br></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>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 them.</div><div><br></div><div>Also: how would you read the value of the 1st indicator of a certain MARC field?</div><div>   - [in this case] it is OK to assume that the field appears in the record just once</div><div><br></div><div>Thanks,</div><div>Uldis</div><div><br></div></div></div></div>