<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Dear Martina,</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
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).</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
E.g. here is a way to add 1 to the year field in the MARC <span style="font-variant-ligatures: no-common-ligatures;">008/07-10 tag:</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-variant-ligatures: no-common-ligatures;"><br>
</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-variant-ligatures: no-common-ligatures;"><span style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures; display: inline !important; background-color: rgb(255, 255, 255);" class="ContentPasted2"># copy 008 date
to the 'date' field</span><br>
</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-variant-ligatures: no-common-ligatures;">
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted0" style="font-variant-ligatures:no-common-ligatures">marc_map(008/07-10,date)</span></p>
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted0" style="font-variant-ligatures:no-common-ligatures"># do some calculation</span></p>
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted0" style="font-variant-ligatures:no-common-ligatures">perlcode(myscript.pl)</span></p>
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted0" style="font-variant-ligatures:no-common-ligatures"># return the 'date' value back into the date field</span></p>
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted0" style="font-variant-ligatures:no-common-ligatures">marc_set(008/07-10,$.date)</span></p>
<br>
</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-variant-ligatures: no-common-ligatures;">where myscript.pl is a file that contains:</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-variant-ligatures: no-common-ligatures;"><br>
</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-variant-ligatures: no-common-ligatures;">
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted1" style="font-variant-ligatures:no-common-ligatures">sub {</span></p>
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted1" style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space ContentPasted1">
</span>my $data = shift;</span></p>
<p class="p2" style="margin:0px;font:14px Menlo;min-height:16px"><span class="s1" style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space ContentPasted1"> </span></span></p>
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted1" style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space ContentPasted1">
</span>$data->{date} = $data->{date} + 1;</span></p>
<p class="p2" style="margin:0px;font:14px Menlo;min-height:16px"><span class="s1" style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space ContentPasted1"> </span></span></p>
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted1" style="font-variant-ligatures:no-common-ligatures"><span class="Apple-converted-space ContentPasted1">
</span>return $data;<span class="Apple-converted-space ContentPasted1"> </span></span></p>
<p class="p1" style="margin:0px;font:14px Menlo"><span class="s1 ContentPasted1" style="font-variant-ligatures:no-common-ligatures">}</span></p>
<br>
</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-variant-ligatures: no-common-ligatures;">BR</span></div>
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span style="font-variant-ligatures: no-common-ligatures;">Patrick</span></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 Siebert, Dr. Martina <Martina.Siebert@sbb.spk-berlin.de><br>
<b>Sent:</b> 27 October 2023 14:25<br>
<b>To:</b> librecat-dev@lists.uni-bielefeld.de <librecat-dev@lists.uni-bielefeld.de><br>
<b>Subject:</b> [librecat-dev] Doing math calculations inside a Catmandu fix</font>
<div> </div>
</div>
<style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:DengXian}
@font-face
{font-family:Calibri}
@font-face
{}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
{color:#0563C1;
text-decoration:underline}
a:visited, span.x_MsoHyperlinkFollowed
{color:#954F72;
text-decoration:underline}
span.x_E-MailFormatvorlage17
{font-family:"Calibri",sans-serif;
color:windowtext}
.x_MsoChpDefault
{font-family:"Calibri",sans-serif}
@page WordSection1
{margin:70.85pt 70.85pt 2.0cm 70.85pt}
div.x_WordSection1
{}
-->
</style>
<div lang="DE" link="#0563C1" vlink="#954F72">
<div class="x_WordSection1">
<p class="x_MsoNormal">Dear all,</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"><span lang="EN-US">I am stuck with this problem:</span></p>
<p class="x_MsoNormal"><span lang="EN-US">I only have a date in Taiwan Republican counting in my data and need a Georgian date for PICA+.</span></p>
<p class="x_MsoNormal"><span lang="EN-US">How do I add 1911 to the value 112 to get 2023?</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span lang="EN-US">Best,</span></p>
<p class="x_MsoNormal"><span lang="EN-US">Martina</span></p>
<p class="x_MsoNormal"><span lang="EN-US"> </span></p>
<p class="x_MsoNormal"><span style="font-size:8.0pt; font-family:"Arial",sans-serif">______________________________________________</span></p>
<p class="x_MsoNormal"><span style="font-size:9.0pt">Dr. Martina Siebert</span></p>
<p class="x_MsoNormal"><span style="font-size:9.0pt">Ostasienabteilung </span><span style="font-size:9.0pt">| CrossAsia</span><span style="font-size:9.0pt"></span></p>
<p class="x_MsoNormal"><span style="font-size:9.0pt">Staatsbibliothek zu Berlin – Preußischer Kulturbesitz</span></p>
<p class="x_MsoNormal"><span style="font-size:9.0pt"> </span></p>
<p class="x_MsoNormal"><span style="font-size:9.0pt"><a href="mailto:martina.siebert@sbb.spk-berlin.de"><span style="color:#0563C1">martina.siebert@sbb.spk-berlin.de</span></a></span><u><span style="color:#0563C1"></span></u></p>
<p class="x_MsoNormal"><span style="font-size:9.0pt"><a href="http://www.staatsbibliothek-berlin.de/" originalsrc="http://www.staatsbibliothek-berlin.de/" shash="Q8Hoq8EPtQy4EZiM9vkrz7p5RGeVkw0ozZ/vnbqKpv+srjjYe6ms5jO2r49zUK5bZ0HuFEXW7SxTxxU6JLYpqpWR2hCpLq+ZH7q3VHtscTeuDYswDx8GGs2eLlDwGr/MNq0xgnnEE/6IvnExqR0+fRtyGutbK7QOKD3WkzKbFQk="><span style="color:#0563C1">www.staatsbibliothek-berlin.de</span></a></span></p>
<p class="x_MsoNormal"><span style="font-size:9.0pt"> </span></p>
<p class="x_MsoNormal"><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: <a href="http://sbb.berlin/datenschutz" originalsrc="http://sbb.berlin/datenschutz" shash="RMz8yNWRfonRoRUVfwlSbo+SyoDxLxl12V6eIIfOWyxSdkyOSR6yxFQKWB8lNwneRsRN3cvAVU4W2+0jeD4gMSgQIBbwXntlxLjfxYQX3JjdKZurJx09heSYtTOTw1nYtcLwtPP4hqpK8i/Lt98WCoxJHNIHxwqEzZsh0XZLmrk=" target="_short" title="Kurz-URL">
<span style="color:#0563C1">http://sbb.berlin/datenschutz</span></a></span></p>
<p class="x_MsoNormal"> </p>
</div>
</div>
</body>
</html>