Using as_string() in Marc::batch

2004-02-25 Thread Sperr, Edwin
I'm using as_string() in Marc::Batch to get 650 fields and mash all the
subfields together so I can push them into a database.  Works great, but
what I'd really like to do is have fields such as:

Health Services Canada.

appear as

Health Services -- Canada.

Basically, I need some dashes to appear between |a, |x and |z.  Is there
something I can do directly with as_string() or do I need to use
as_formatted() and try to roll my own search-and-replace routine?


Thanks!

Ed Sperr   ([EMAIL PROTECTED])

Education / Electronic Resources Librarian
New England College of Optometry Library

  


RE: Using as_string() in Marc::batch

2004-02-25 Thread Holly Bravender
I don't want to subscribe to this list.  Please take me off.  Thanks

Holly Bravender
Reference  Instruction Librarian
Paul V. Galvin Library  
Illinois Institute of Technology
35 W. 33rd Street 
Chicago, IL  60616
www.gl.iit.edu 
(312) 567-3373
[EMAIL PROTECTED] 

-Original Message-
From: Sperr, Edwin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 8:35 AM
To: [EMAIL PROTECTED]
Subject: Using as_string() in Marc::batch


I'm using as_string() in Marc::Batch to get 650 fields and mash all the
subfields together so I can push them into a database.  Works great, but
what I'd really like to do is have fields such as:

Health Services Canada.

appear as

Health Services -- Canada.

Basically, I need some dashes to appear between |a, |x and |z.  Is there
something I can do directly with as_string() or do I need to use
as_formatted() and try to roll my own search-and-replace routine?


Thanks!

Ed Sperr   ([EMAIL PROTECTED])

Education / Electronic Resources Librarian
New England College of Optometry Library

  


Re: Using as_string() in Marc::batch

2004-02-25 Thread Andy Lester
 I'm using as_string() in Marc::Batch to get 650 fields and mash all the
 subfields together so I can push them into a database.  Works great, but
 what I'd really like to do is have fields such as:
 
 Health Services Canada.
 
 appear as
 
 Health Services -- Canada.

Well, it's MARC::Field that is doing the as_string().

The dashes between the a, x, y and z is bringing me back to 1991 when I
was working on the punctuation for the CardMaster Plus product for
Follett Software.  What I had to do back then was create a big table
that summarized the AACR2 rules as best as possible.  It was big mess,
with certain punctuation coming before certain fields, and some after.
For example, in your Health Services -- Canada, the  --  isn't after
the _a subfield, but rather that it's before the _x.

All that was in C, before object-oriented programming (at least in
our shop), so these days we'd probably have a MARC::Field::650 subclass
that overrides the as_string() method.  That could get pretty hairy for
all the potential tags running around, especially since 600 and 650 and
a good many other 6xx tags would be similar.

I'm open to ideas.

xoa

-- 
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance


RE: Using as_string() in Marc::batch

2004-02-25 Thread Sperr, Edwin
I'm using as_string() in Marc::Batch to get 650 fields and mash all the
subfields together so I can push them into a database. 
Works great, but what I'd really like to do is have fields such as:

Health Services Canada.

appear as

Health Services -- Canada.


For the time being, I've decided to go the regexp route.  It looks like
this works:

# dump 'em out as pretty-print
my $category = $localsubject-as_formatted();
# strip off the 6xx and indicators
$category =~ s/6..\b.*_a//g;
# collapse subfields into single line with dashes
$category =~ s/\s*\n\s*_[xvz]/ -- /g;


Ed Sperr   ([EMAIL PROTECTED])

Education / Electronic Resources Librarian
New England College of Optometry Library