<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hello,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
These JSON-paths were not yet supported in the indicator positions of the marc_add fix. In version 1.30 of Catmandu::MARC, which is now on its way to CPAN, this has been solved and your script should work.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
BR</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Patrick</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> librecat-dev-bounces@lists.uni-bielefeld.de <librecat-dev-bounces@lists.uni-bielefeld.de> on behalf of Tiago Murakami <trmurakami@gmail.com><br>
<b>Sent:</b> 26 May 2023 22:48<br>
<b>To:</b> librecat-dev@lists.uni-bielefeld.de <librecat-dev@lists.uni-bielefeld.de><br>
<b>Subject:</b> [librecat-dev] Ind 2 in 245 field</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hi, <br>
</div>
<div><br>
</div>
<div>I wrote an script to count <span>number of nonfiling characters</span> in 245 field:</div>
<div><br>
<div style="margin-left:40px">marc_map('245a', my.title)<br>
marc_map('245a', my.titletrim)<br>
trim(my.titletrim)<br>
marc_map('245b', my.subtitle)<br>
marc_map('245c', my.titleresponsability)<br>
trim(my.title)<br>
parse_text(my.title,'^([\w\-]+)')<br>
copy_field(my.title.0, my.article)<br>
lookup(my.article, "fixes/artigos.csv", sep_char:",")<br>
marc_remove(245)<br>
if is_number(my.article)<br>
    if all_equal(my.article, 2)<br>
        marc_add('245', 'ind1', 0, 'ind2', 2, 'a', $.my.titletrim, 'b', $.my.subtitle, 'c', $.my.titleresponsability)<br>
    end<br>
    if all_equal(my.article, 3)<br>
        marc_add('245', 'ind1', 0, 'ind2', 3, 'a', $.my.titletrim, 'b', $.my.subtitle, 'c', $.my.titleresponsability)<br>
    end<br>
    if all_equal(my.article, 4)<br>
        marc_add('245', 'ind1', 0, 'ind2', 4, 'a', $.my.titletrim, 'b', $.my.subtitle, 'c', $.my.titleresponsability)<br>
    end<br>
    if all_equal(my.article, 5)<br>
        marc_add('245', 'ind1', 0, 'ind2', 5, 'a', $.my.titletrim, 'b', $.my.subtitle, 'c', $.my.titleresponsability)<br>
    end<br>
    if all_equal(my.article, 6)<br>
        marc_add('245', 'ind1', 0, 'ind2', 6, 'a', $.my.titletrim, 'b', $.my.subtitle, 'c', $.my.titleresponsability)<br>
    end <br>
else<br>
    marc_add('245', 'ind1', 0, 'ind2', 0, 'a', $.my.titletrim, 'b', $.my.subtitle, 'c', $.my.titleresponsability)<br>
end <br>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>My question is why this script works and this one doesn't:</div>
<div><br>
</div>
<div style="margin-left:40px">if is_number(my.article) </div>
<div style="margin-left:40px">    marc_add('245', 'ind1', 0, 'ind2',  $.my. article, 'a', $.my.titletrim, 'b', $.my.subtitle, 'c', $.my.titleresponsability)
<br>
</div>
<div style="margin-left:40px">end<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>My fixes/artigos.csv file example: <br>
</div>
<div><br>
</div>
<div>
<pre>O,2
Os,3
A,2
As,3
Um,3
Uns,4
Uma,4
Umas,5
Ao,3
Aos,4</pre>
</div>
<div><br>
</div>
<div>If you can help me I will be grateful</div>
<div><br>
</div>
<div>Thanks in advance, <br>
</div>
<div><br>
</div>
<br>
<span class="x_gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="x_gmail_signature" data-smartmail="gmail_signature">Tiago Murakami</div>
<div class="x_gmail_signature" data-smartmail="gmail_signature">Bibliotecário<br>
</div>
</div>
</div>
</body>
</html>