Custom Report Writer: Call Number Example

When using the Custom Formatted Reports — it is generally possible to create a call numbers list that can be used for printing. Please note, one challenge with labels is that label printers often have their own control sets, and I haven’t tested this process specifically against a set of label printers. If this proves to be something the community desires, I’ll look at how to add specific drivers/translators for printing to specified label printers.

Example Record:

=LDR  01392cam a2200325Ki 4500
=001 99153751199003941
=005 20190220161915.0
=008 180727s2017\\sw\\\\\\000\1\perrd
=010 \$a 2018371588
=020 \$a9789163923609
=020 \$a9163923602
=035 \$a(OCoLC)1046449050
=040 \$aZYU$beng$erda$cZYU$dOCLCF$dDLC
=043 \$aa-ir---
=050 \4$aBP189$b.N84 2017
=100 1\$6880-01$aNuhʹrūdī, Riz̤ā,$eauthor.
=880 1\$6100-01//r$aنه‌رودى، رضا‎
=245 10$6880-02$aSīrat-i ān rūy-i sikkah :$bḥaqīqat-i jamāl-i ṣūrat va kamāl-i sīrat-i ādamʹhā /$cnivīsandah va shāʻir: Riz̤ā Nuhʹrūdī (mansūb bih Ḥaqqʹbīn)
=880 10$6245-02//r$aسىرت آن روى سكه :‎$bحقىقت جمال صورت و کمال سىرت آدمه‌ا /‎$cنوىسنده و شاعر: رضا نهر‌ودى (منسوب به حقب‌ىن)‎
=250 \$6880-03$aChāp-i nakhust.
=880 \$6250-03//r$aچاپ نخست.‎
=264 \1$aSolna (Sweden) :$bArash Förlag, 2017.
=300 \$a350 pages ;$c21 cm
=336 \$atext$2rdacontent
=337 \$aunmediated$2rdamedia
=338 \$avolume$2rdacarrier
=546 \$aIn Persian.
=650 \0$aMysticism$xIslam.
=650 \7$aMysticism$xIslam.$2fast$0(OCoLC)fst01031643
=880 \1$6264-00$aسوئد [Sweden] :‎$bانتشارات آرش،‎$c‪2017‬.

To output a label, pulling from the 050 where the label format is up to 11 lines — the format would look like the following:

BP
189
.N84
2017

You would use the following:

{050$a}.regex("([^0-9]*)(.*)","$1\n$2")
{050$b}.regex("([^\s]*)( )(.*)", "$1\n$3")
{lines}.pad(11)

Above, you can see the arguments list uses the .regex syntax and then finishes with the {lines} mnemonic with the .pad function that tells the program that all blocks should have a total of 11 lines.