Saiful Amin a écrit :
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 '<>' ?)**/
my @keywords = split /></,">$keywords<";
# the > & < at beginning & end is to have correct >< everywhere

foreach $keyword (@keywords) {
$record->append_fields( MARC::Field->new('653',0,'',
'a' => "$keyword"
) if $keyword; # avoid creating a subfield for empty keyword (1st & last entry of the array
}

Can someone please help me out? Thanks in advance.
You're welcome

--
Paul POULAIN
Consultant indépendant en logiciels libres
responsable francophone de koha (SIGB libre http://www.koha-fr.org)

Reply via email to