Hi Jane:
On Tue, Jan 11, 2005 at 01:29:55PM -0500, Jacobs, Jane W wrote:
> My result was something like:
>
> Dave,Ayod\2003
> Pa�t,Ka�s\2002
> Baks,Dasa\2003
> ,Vi�s\2002
>
> Problem 1: As you can see, I don't really want the first four characters, I
> want the first four SEARCHABLE characters. How can I tell MARC Record to
> give me the first four characters, excluding diacritics?
What output would you have rather seen?
Dave,Ayod\2003
Paot, Kaas\2002
Baks,Dasa\2003
,Vias\2002
?
> Problem 2: In these examples 260 $c works OK, but I could get a cleaner
> result by accessing the date from the fixed field (008 07-10). How would I
> do that? I was looking in the tutorial, but couldn't seem to find anything
> that seemed to help. If I'm missing something there please point it up.
You probably want to use the data() method on the MARC::Field object for
the '008' field, in combination with substr() to extract a substring
based on an offset and a length.
my $f008 = $record->field('008');
if ( $f008 ) { $year = substr( $f008->data(), 7, 4 ); }
I only added the if statement since it may not be true that all your
records have an 008 field...
//Ed