Amin,

This should do the trick:

my @keywords = split(/[<>]+/,$keywords );

Ian

_____________________________________________
Ian Hamilton 
Library Systems Administrator
European Commission - Directorate General for Education and Culture 
EAC C4 - Central Library Unit 
* +32-2-295.24.60 (direct phone) 
* +32-2-299.91.89 (fax)
 http://europa.eu.int/comm/dgs/education_culture/index_en.htm
 http://europa.eu.int/comm/libraries/index.htm
 http://europa.eu.int/eclas/

-----Original Message-----
From: Saiful Amin [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 31, 2005 2:32 PM
To: perl4lib@perl.org
Subject: Separating index terms


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 '<>' ?)**/ 

foreach $keyword (@keywords) {
$record->append_fields( MARC::Field->new('653',0,'',
'a' => "$keyword"
);
}

Can someone please help me out? Thanks in advance.

Regards,
Saiful

-- 
Saiful Amin
Information Specialist
Edutech India
8 Khader Nawaz Khan Road
Chennai 600006, India
Tel: +91 44 2833 0999
GSM: +91 98407 76214
Fax: +91 44 2833 1777
www.edutechindia.com <http://www.edutechindia.com>
"Enhancing knowledge and skills for success, lifelong."

Reply via email to