[librecat-dev] fix with Catmandu identifier
Patrick Hochstenbach
Patrick.Hochstenbach at UGent.be
Mon May 22 16:37:42 CEST 2017
Hi
I can’t give you a complete application but here is a hint for some fixes:
# Loop over all fields one-by-one
do marc_each()
# If the field is a 020
if marc_match("020",".*")
# Extract the isbn
marc_map(020a,isbn)
# Clean the ISBN a bit
replace_all(isbn,' .*','')
# If the ISBN is not valid..
unless is_valid_isbn(isbn)
# Remove the 020a field
marc_remove('020a’)
# Set the 020z field with the invalid ISBN
marc_set('020z',$.isbn)
end
end
end
Best
Patrick
> On 20 May 2017, at 15:11, Jorg Delutan <jdelutan at gmail.com> wrote:
>
> Dear all,
>
> i try to use Catmandu-Identifier, with the use of Catmandu::Fix::Condition::is_valid_isbn-condition.
> and i do this, as Basil described, for example, i delete the $a with the invalid ISBN, ISSN, and then create a new subfield, $z, with the invalid ISBN, ISSN..
>
> So i also would appreciate, after the issue is closed an example, of how i could use it, in an elegant way, in order to move all invalid isbn numbers, to $z, of tag 010, and all invalid ISSN numbers, in tag 011 $z respectively.
>
> Best regards
>
> _______________________________________________
> librecat-dev mailing list
> - send list mails to librecat-dev at lists.uni-bielefeld.de
> - to unsubscribe or change options, visit https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev
> - project website: http://librecat.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20170522/0bc51f25/attachment.asc>
More information about the librecat-dev
mailing list