[librecat-dev] Ind 2 in 245 field

Tiago Murakami trmurakami at gmail.com
Sat May 27 14:41:19 CEST 2023


Great, thanks!

On Sat, May 27, 2023 at 1:22 AM Patrick Hochstenbach <
Patrick.Hochstenbach at ugent.be> wrote:

> Hello,
>
> 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.
>
> BR
> Patrick
> ------------------------------
> *From:* librecat-dev-bounces at lists.uni-bielefeld.de <
> librecat-dev-bounces at lists.uni-bielefeld.de> on behalf of Tiago Murakami <
> trmurakami at gmail.com>
> *Sent:* 26 May 2023 22:48
> *To:* librecat-dev at lists.uni-bielefeld.de <
> librecat-dev at lists.uni-bielefeld.de>
> *Subject:* [librecat-dev] Ind 2 in 245 field
>
> Hi,
>
> I wrote an script to count number of nonfiling characters in 245 field:
>
> marc_map('245a', my.title)
> marc_map('245a', my.titletrim)
> trim(my.titletrim)
> marc_map('245b', my.subtitle)
> marc_map('245c', my.titleresponsability)
> trim(my.title)
> parse_text(my.title,'^([\w\-]+)')
> copy_field(my.title.0, my.article)
> lookup(my.article, "fixes/artigos.csv", sep_char:",")
> marc_remove(245)
> if is_number(my.article)
>     if all_equal(my.article, 2)
>         marc_add('245', 'ind1', 0, 'ind2', 2, 'a', $.my.titletrim, 'b',
> $.my.subtitle, 'c', $.my.titleresponsability)
>     end
>     if all_equal(my.article, 3)
>         marc_add('245', 'ind1', 0, 'ind2', 3, 'a', $.my.titletrim, 'b',
> $.my.subtitle, 'c', $.my.titleresponsability)
>     end
>     if all_equal(my.article, 4)
>         marc_add('245', 'ind1', 0, 'ind2', 4, 'a', $.my.titletrim, 'b',
> $.my.subtitle, 'c', $.my.titleresponsability)
>     end
>     if all_equal(my.article, 5)
>         marc_add('245', 'ind1', 0, 'ind2', 5, 'a', $.my.titletrim, 'b',
> $.my.subtitle, 'c', $.my.titleresponsability)
>     end
>     if all_equal(my.article, 6)
>         marc_add('245', 'ind1', 0, 'ind2', 6, 'a', $.my.titletrim, 'b',
> $.my.subtitle, 'c', $.my.titleresponsability)
>     end
> else
>     marc_add('245', 'ind1', 0, 'ind2', 0, 'a', $.my.titletrim, 'b',
> $.my.subtitle, 'c', $.my.titleresponsability)
> end
>
>
> My question is why this script works and this one doesn't:
>
> if is_number(my.article)
>     marc_add('245', 'ind1', 0, 'ind2',  $.my. article, 'a',
> $.my.titletrim, 'b', $.my.subtitle, 'c', $.my.titleresponsability)
> end
>
>
> My fixes/artigos.csv file example:
>
> O,2
> Os,3
> A,2
> As,3
> Um,3
> Uns,4
> Uma,4
> Umas,5
> Ao,3
> Aos,4
>
>
> If you can help me I will be grateful
>
> Thanks in advance,
>
>
> --
> Tiago Murakami
> Bibliotecário
>


-- 
Tiago Murakami
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20230527/124370a8/attachment.html>


More information about the librecat-dev mailing list