Saiful Amin wrote:
Hi all,
I'm doing some data cleaning for MARC data. The MARC export I got from a
legacy system has field 653 in following format:
$a <Finance><Finance personal><Financial planning><Liquidity management>
I want to create repeatable field separating the individual index terms.
my $tag_653 = $record->field('653');
$record->delete_field('653');
my $keywords = $tag_653->subfield('a');
/*** I'm lost here (How do I separate keywords trapped in '<>' ?)**/
I'm not sure I completely understand what you're after, but if all you
want to do is create an array of elements, where each element is the
text inside the <> delimiters, you could do this:
# Get rid of everything up to and including the first "<"
$keyword =~ s/^.*?<//;
# Get rid of everything from the last ">" to the end of the line
$keyword =~ s/>[^>]*$//;
# We now have fields delimited by "><", so we can just split at that
# delimiter:
my @keywords = split ('><', $keyword);
--
William Wueppelmann
Canadiana.org
(formerly Canadian Institute for Historical Microreproductions)
http://www.canadiana.org