<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="en-BE" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="NL" style="font-size:14.0pt;font-family:"Aptos",sans-serif;mso-fareast-language:EN-US">Hi<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="NL" style="font-size:14.0pt;font-family:"Aptos",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Aptos",sans-serif;mso-fareast-language:EN-US">I’m sorry this is such a pain. This fix should do the trick:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Aptos",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">do marc_each()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">if marc_match(8806,'100')<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> set_field(zzz,true)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">end<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">if marc_match(1006,'880')<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US"> set_field(yyy,true)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">end<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">end<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">retain(_id,yyy,zzz)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Aptos",sans-serif;mso-fareast-language:EN-US">which will result in:<br>
<br>
</span><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">% catmandu convert MARC to YAML --fix my.fix < author.mrc<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">---<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">_id: in00005597484<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">---<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">_id: in00005597483<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">yyy: 'true'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">zzz: 'true'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Courier New";mso-fareast-language:EN-US">...<br>
<br>
</span><span lang="EN-US" style="font-size:14.0pt;font-family:"Aptos",sans-serif;mso-fareast-language:EN-US">It is safer when you need to reason over MARC fields that are repeated (such as the 880) field to use the `do marc_each() …. end` construct. This will
process a MARC record line by line.<br>
<br>
BR<br>
Patrick<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:"Aptos",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span lang="DE" style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">From:
</span></b><span lang="DE" style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">librecat-dev-bounces@lists.uni-bielefeld.de <librecat-dev-bounces@lists.uni-bielefeld.de> on behalf of Siebert, Dr. Martina <Martina.Siebert@sbb.spk-berlin.de><br>
<b>Date: </b>Monday, 11 March 2024 at 18:45<br>
<b>To: </b>librecat-dev@lists.uni-bielefeld.de <librecat-dev@lists.uni-bielefeld.de><br>
<b>Subject: </b>[librecat-dev] marc_match does not like 8806?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">I am lost </span>
<span lang="DE" style="font-size:11.0pt;font-family:Wingdings">L</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">I am now fighting my way through a mixed pile of single- and multi-script MARC-records.</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">This was meant as a simple check if there exists a non-Latn version of – for example - the author field (MARC 100) - here tested with “convert to YAML” to see if it is working at all:</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:black">if marc_match(8806,'100')</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:black">set_field(zzz,true)</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:black">end</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">But it doesn’t work.</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">But this does:</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:black">if marc_match(1006,'880')</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:black">set_field(yyy,true)</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:black">end</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">What am I missing?
</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">I attach a 2 record sample (one with a non-linked 100, one with 100$6880). The second one should return both zzz:true, yyy:true but only returns yyy:true.</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">(just starting from the 100 field is not an option, because sometimes the $6880 is missing in the records I have, while the 880ies seem all to have $6 references)</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Best,</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Martina</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:8.0pt;font-family:"Arial",sans-serif">______________________________________________</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt">Dr. Martina Siebert</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt">Ostasienabteilung | CrossAsia</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt">Staatsbibliothek zu Berlin
</span><span lang="DE" style="font-size:9.0pt">– Preußischer Kulturbesitz</span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:9.0pt"> </span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:9.0pt"><a href="mailto:martina.siebert@sbb.spk-berlin.de">martina.siebert@sbb.spk-berlin.de</a></span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:9.0pt"><a href="http://www.staatsbibliothek-berlin.de/">www.staatsbibliothek-berlin.de</a></span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:9.0pt"> </span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:9.0pt">Im Rahmen der E-Mail-Kommunikation werden gegebenenfalls personenbezogene Daten verarbeitet.
<br>
Unsere Hinweise zum Datenschutz finden Sie hier: <a href="http://sbb.berlin/datenschutz" target="_short" title="Kurz-URL">
http://sbb.berlin/datenschutz</a></span><span lang="DE" style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE" style="font-size:11.0pt"> <o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>