<html xmlns:v="urn:schemas-microsoft-com:vml" 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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Menlo;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.p1, li.p1, div.p1
{mso-style-name:p1;
mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.p2, li.p2, div.p2
{mso-style-name:p2;
mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
{mso-style-name:x_msonormal;
mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.xmsochpdefault, li.xmsochpdefault, div.xmsochpdefault
{mso-style-name:x_msochpdefault;
mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
span.contentpasted2
{mso-style-name:contentpasted2;}
span.s1
{mso-style-name:s1;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.xmsohyperlink
{mso-style-name:x_msohyperlink;
color:#0563C1;
text-decoration:underline;}
span.xmsohyperlinkfollowed
{mso-style-name:x_msohyperlinkfollowed;
color:#954F72;
text-decoration:underline;}
span.xe-mailformatvorlage17
{mso-style-name:x_e-mailformatvorlage17;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.E-MailFormatvorlage29
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Dear Patrick,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">great! Thanks!!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I needed to change the call-up of the Perl script to<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:black">perlcode(</span><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:red">./</span><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;color:black">myscript.pl)</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Nicely the error message told me what needed to change.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Martina<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Patrick Hochstenbach <Patrick.Hochstenbach@UGent.be>
<br>
<b>Gesendet:</b> Freitag, 27. </span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Oktober 2023 14:49<br>
<b>An:</b> Siebert, Dr. Martina <Martina.Siebert@sbb.spk-berlin.de>; librecat-dev@lists.uni-bielefeld.de<br>
<b>Betreff:</b> Re: Doing math calculations inside a Catmandu fix<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">Dear Martina,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">Perl fixes have a very limited support for calculations. But with the perlcode fix you can do any kind of calculation possible in Perl (and that is a lot).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">E.g. here is a way to add 1 to the year field in the MARC 008/07-10 tag:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"><br>
<br>
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span class="contentpasted2"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black;background:white"># copy 008 date to the 'date' field</span></span><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"><br>
<br>
<o:p></o:p></span></p>
</div>
<div>
<p class="p1"><span class="s1"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">marc_map(008/07-10,date)</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p1"><span class="s1"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"># do some calculation</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p1"><span class="s1"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">perlcode(myscript.pl)</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p1"><span class="s1"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"># return the 'date' value back into the date field</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p1"><span class="s1"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">marc_set(008/07-10,$.date)</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"><br>
<br>
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">where myscript.pl is a file that contains:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"><br>
<br>
<o:p></o:p></span></p>
</div>
<div>
<p class="p1"><span class="s1"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">sub {</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">
</span></span><span class="s1"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">my $data = shift;</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p2" style="min-height:16px"><span class="apple-converted-space"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"> </span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">
</span></span><span class="s1"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">$data->{date} = $data->{date} + 1;</span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p2" style="min-height:16px"><span class="apple-converted-space"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"> </span></span><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p1"><span class="apple-converted-space"><span lang="EN-US" style="font-size:10.5pt;font-family:"Menlo",serif;color:black">
</span></span><span class="s1"><span style="font-size:10.5pt;font-family:"Menlo",serif;color:black">return $data;</span></span><span class="apple-converted-space"><span style="font-size:10.5pt;font-family:"Menlo",serif;color:black"> </span></span><span style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="p1"><span class="s1"><span style="font-size:10.5pt;font-family:"Menlo",serif;color:black">}</span></span><span style="font-size:10.5pt;font-family:"Menlo",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black"><br>
<br>
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">BR<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif;color:black">Patrick<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
</span><a href="mailto:librecat-dev-bounces@lists.uni-bielefeld.de"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">librecat-dev-bounces@lists.uni-bielefeld.de</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
<</span><a href="mailto:librecat-dev-bounces@lists.uni-bielefeld.de"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">librecat-dev-bounces@lists.uni-bielefeld.de</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">>
on behalf of Siebert, Dr. Martina <</span><a href="mailto:Martina.Siebert@sbb.spk-berlin.de"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Martina.Siebert@sbb.spk-berlin.de</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">><br>
<b>Sent:</b> 27 October 2023 14:25<br>
<b>To:</b> </span><a href="mailto:librecat-dev@lists.uni-bielefeld.de"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">librecat-dev@lists.uni-bielefeld.de</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">
<</span><a href="mailto:librecat-dev@lists.uni-bielefeld.de"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">librecat-dev@lists.uni-bielefeld.de</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">><br>
<b>Subject:</b> [librecat-dev] Doing math calculations inside a Catmandu fix</span><span lang="EN-US">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="xmsonormal"><span lang="EN-US">Dear all,<o:p></o:p></span></p>
<p class="xmsonormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="xmsonormal"><span lang="EN-US">I am stuck with this problem:<o:p></o:p></span></p>
<p class="xmsonormal"><span lang="EN-US">I only have a date in Taiwan Republican counting in my data and need a Georgian date for PICA+.<o:p></o:p></span></p>
<p class="xmsonormal"><span lang="EN-US">How do I add 1911 to the value 112 to get 2023?<o:p></o:p></span></p>
<p class="xmsonormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="xmsonormal">Best,<o:p></o:p></p>
<p class="xmsonormal">Martina<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:8.0pt;font-family:"Arial",sans-serif">______________________________________________</span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:9.0pt">Dr. Martina Siebert</span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:9.0pt">Ostasienabteilung | CrossAsia</span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:9.0pt">Staatsbibliothek zu Berlin – Preußischer Kulturbesitz</span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:9.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal"><a href="mailto:martina.siebert@sbb.spk-berlin.de"><span style="font-size:9.0pt">martina.siebert@sbb.spk-berlin.de</span></a><o:p></o:p></p>
<p class="xmsonormal"><a href="http://www.staatsbibliothek-berlin.de/"><span style="font-size:9.0pt">www.staatsbibliothek-berlin.de</span></a><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:9.0pt"> </span><o:p></o:p></p>
<p class="xmsonormal"><span style="font-size:9.0pt">Im Rahmen der E-Mail-Kommunikation werden gegebenenfalls personenbezogene Daten verarbeitet.
<br>
Unsere Hinweise zum Datenschutz finden Sie hier: </span><a href="http://sbb.berlin/datenschutz" target="_short" title="Kurz-URL"><span style="font-size:9.0pt">http://sbb.berlin/datenschutz</span></a><o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>