Patrick.Hochstenbach at UGent.be
Thu Jul 20 11:24:08 CEST 2017
You can do a cut and past on every field and do the renaming:
# For each marc field...
# Cut the field into tmp..
# Rename every 1 subfield to 0
# And paste it back
The `rename` fix allows regexes so you can replace '1' with any regex you like.
From: librecat-dev-bounces at lists.uni-bielefeld.de <librecat-dev-bounces at lists.uni-bielefeld.de> on behalf of Schihin Oliver <Oliver.Schihin at zhbluzern.ch>
Sent: Thursday, July 20, 2017 10:46 AM
To: librecat-dev at lists.uni-bielefeld.de
Subject: [librecat-dev] marc_rename
Is there an easy way to rename MARC subfield codes (not values) according to a regex condition? I am sure someone has an easy trick I just can't find.
Case: Due to ALEPH internals, subfields holding identifiers are $1, not $0 as in the standard. I should change these in a conversion (MARC to MARC).
rename(tmp, '1', '0')
Downside is the positioning of the pasting, even with the at: parameter.
Ideal would be a fix like 'marc_rename' that allows for a selection with a regex.
Thanks for hints
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the librecat-dev