Thanks for your ideas. I will try your suggestions.
John
From: Timothy Prettyman [mailto:timo...@umich.edu]
Sent: Friday, May 30, 2014 11:39 AM
To: perl4lib
Subject: Re: sending marc records into a script that uses MARC::Batch
I think you have to check for warnings as you read each record, so
:* Thursday, May 29, 2014 11:23 AM
> *To:* John E Guillory
> *Cc:* perl4lib@perl.org
> *Subject:* Re: sending marc records into a script that uses MARC::Batch
>
>
>
> For your first question, instead of:
>
>
>
> $batch = MARC::Batch->new(‘USMARC’,);
>
>
>
the script exited prematurely.
>
> Thanks for assistance.
> John
>
>
>
>
>
>
> From: Timothy Prettyman [mailto:timo...@umich.edu]
> Sent: Thursday, May 29, 2014 11:23 AM
> To: John E Guillory
> Cc: perl4lib@perl.org
> Subject: Re: sending marc re
John E Guillory schreef op do 29-05-2014 om 21:13 [+]:
> “Warnings detected: Entirely empty subfield found in tag 260”
An entirely empty subfield is an illegally formatted thing, at least
according to the rules of MARC::Record/MARC::Field, and so I assume the
MARC format itself. So it's not th
records into a script that uses MARC::Batch
For your first question, instead of:
$batch = MARC::Batch->new(‘USMARC’,);
use:
$batch = MARC::Batch->new(‘USMARC’,STDIN);
For your second, the error is likely caused when a field you're using
as_string() on doesn't exist in the record
For your first question, instead of:
$batch = MARC::Batch->new(‘USMARC’,);
use:
$batch = MARC::Batch->new(‘USMARC’,STDIN);
For your second, the error is likely caused when a field you're using
as_string() on doesn't exist in the record.
So, you could do something like the fo
Hello,
Two questions please:
1. I've written a script that opens a marc file for reading using this
syntax:
$file = $ARGV[0];
$batch = MARC::Batch->new('USMARC',$file);
It then loops thru the records using this syntax:
while ( $record = $batch->next()) {
...
e leaders
of all of the records need to have a value of "a" set in position #9 of the
leader. So I wrote the following hack (circumventing MARC::Batch):
#!/usr/bin/perl
# require
use strict;
# initialize
binmode STDIN, ":bytes";
binmode STDOUT, &
Eric,
> How can I figure out whether or not a MARC record contains ONLY characters
> from the UTF-8 character set?
You can use a regex to check if a string is utf-8. There are various examples
floating around the internet. An example is the one here:
http://www.w3.org/International/questions
Hi,
On Wed, Mar 27, 2013 at 2:11 PM, Eric Lease Morgan wrote:
> Put another way, how can I determine whether or not position #9 of a given
> MARC leader is accurate? If position #9 is an "a", then how can I read the
> balance of the record to determine whether or not all the characters really
>
helley
- Original Message -
> From: "Eric Lease Morgan"
> To: perl4lib@perl.org
> Sent: Wednesday, March 27, 2013 2:11:26 PM
> Subject: Re: reading and writing of utf-8 with marc::batch [double encoding]
>
>
> On Mar 27, 2013, at 4:59 PM, Eric Lease Morgan
> wro
On Mar 27, 2013, at 4:59 PM, Eric Lease Morgan wrote:
> When it calls as_usmarc, I think MARC::Batch tries to honor the value set in
> position #9 of the leader. In other words, if the leader is empty, then it
> tries to output records as MARC-8, and when the leader is a value o
On Mar 27, 2013, at 2:20 PM, Eric Lease Morgan wrote:
> A number of people have alluded to the problem of double encoding, and I'm
> beginning to think this is true.
When it calls as_usmarc, I think MARC::Batch tries to honor the value set in
position #9 of the leader. In othe
Hi,
On Wed, Mar 27, 2013 at 11:20 AM, Eric Lease Morgan wrote:
> I have isolated a number of problem records. They all contain diacritics,
> but they do not have an "a" in position #9 of the leader --
> http://dh.crc.nd.edu/tmp/original.marc Can someone verify that the file
> contains UTF-8 cha
A number of people have alluded to the problem of double encoding, and I'm
beginning to think this is true.
I have isolated a number of problem records. They all contain diacritics, but
they do not have an "a" in position #9 of the leader --
http://dh.crc.nd.edu/tmp/original.marc Can someone
Sent: Tuesday, March 26, 2013 1:22:03 PM
> Subject: reading and writing of utf-8 with marc::batch
>
>
> For the life of me I can't figure out how to do reading and writing
> of UTF-8 with MARC::Batch.
>
> I have a UTF-8 encoded file of MARC records. Dumping the records
Hi Eric,
On Wed, Mar 27, 2013 at 10:26 AM, Eric Lease Morgan wrote:
> While I'm not positive my terminal is doing UTF-8, I think it is. When I
> dump in the beginning the output to the terminal is correct. After I run my
> script the output to the same terminal is incorrect.
>
Would you be will
On Mar 26, 2013, at 5:57 PM, Leif Andersson wrote:
> my first guess would be your terminal is not utf8.
While I'm not positive my terminal is doing UTF-8, I think it is. When I dump
in the beginning the output to the terminal is correct. After I run my script
the output to the same terminal i
Hi,
On Wed, Mar 27, 2013 at 7:01 AM, Jon Gorman wrote:
> One piece of advice is not to trust the terminal directly but pipe
> into xxd. (And if possible, just try transforming the offending
> record). Or use yaz-marcdump -v, which will also give the hex if I
> remember correctly. (If it's c3 a9
Ok, I can't claim to be an expert, but from my own experience, I'd say
Paul is very likely right about double-encoding occuring. However,
the question ends up being where that happens, and in this case I
suspect how MARC::Batch will work could depend heavily on what version
of perl you&
e-first-time
Morgan!"
Mike
> -Original Message-
> From: Leif Andersson [mailto:leif.anders...@sub.su.se]
> Sent: Tuesday, March 26, 2013 5:57 PM
> To: Eric Lease Morgan; perl4lib@perl.org
> Subject: Re: reading and writing of utf-8 with marc::batch
>
> Hi Eric,
>
Eric,
Have you tried checking how MARC::Batch views the encoding?
e.g.
# read & write
while ( my $marc = $batch->next ) { print $marc->encoding(); print
$marc->as_usmarc; }
It is supposed to pick up the encoding from 09 in the leader but I am not sure
this is totally reliable
rsson
Stockholm UL
Från: Eric Lease Morgan [emor...@nd.edu]
Skickat: den 26 mars 2013 21:22
Till: perl4lib@perl.org
Ämne: reading and writing of utf-8 with marc::batch
For the life of me I can't figure out how to do reading and writing of UTF-8
with MA
nd writing of
> UTF-8 with MARC::Batch.
>
> I have a UTF-8 encoded file of MARC records. Dumping the records and
> greping for a particular string illustrates the validity:
>
> $ marcdump und.marc | grep Sainte-Face
> und.marc
> 1000 records
> 2000 records
&g
On Tue, Mar 26, 2013 at 04:22:03PM -0400, Eric Lease Morgan wrote:
> For the life of me I can't figure out how to do reading and writing of
> UTF-8 with MARC::Batch.
>
> I have a UTF-8 encoded file of MARC records. Dumping the records and
> greping for a particular st
For the life of me I can't figure out how to do reading and writing of UTF-8
with MARC::Batch.
I have a UTF-8 encoded file of MARC records. Dumping the records and greping
for a particular string illustrates the validity:
$ marcdump und.marc | grep Sainte-Face
und.marc
1000 re
in
Cc: perl4lib@perl.org
Subject: Re: MARC::Batch question
As I deal with this all the time I've started including code to spit out these
records into their own file. That has been very useful:
my $batch = MARC::Batch->new('USMARC', '../full_export.out');
$batch-&g
As I deal with this all the time I've started including code to spit out these
records into their own file. That has been very useful:
my $batch = MARC::Batch->new('USMARC', '../full_export.out');
$batch->strict_off();
$batch->warnings_off();
my ($record,
ate a
use as in many langages.
Good luck ;)
Jonathan
2011/10/14 Zhang, Bin
> Hi,
>
> I have to admit my Perl skill is very limited, so this may be a dumb
> question, but I can't seem to find answer. When I use MARC::Batch to read
> records from our catalog (III) export file,
> I have to admit my Perl skill is very limited, so this may be a dumb
question,
> but I can't seem to find answer. When I use MARC::Batch to read
records from
> our catalog (III) export file, I can't seem to find a way to skip an
error
> record. When I ran the following
Hi,
I have to admit my Perl skill is very limited, so this may be a dumb question,
but I can't seem to find answer. When I use MARC::Batch to read records from
our catalog (III) export file, I can't seem to find a way to skip an error
record. When I ran the following against an
852:0 $byr$hPL6201$i.L49 1998
v.2: $a
Simplest code to reproduce:
#!/m1/shared/bin/perl -w
use MARC::Batch;
$batch = MARC::Batch->new('USMARC', $ARGV[0]);
$batch->strict_off();
while ( $record = $batch->next() ) {
print $record->as_formatted();
}
I expected this code
On Feb 26, 2007, at 12:38 PM, John D Thiesen wrote:
This is presumably an obvious question to most of you, but where do
I get MARC::Batch? I used it about a year ago in a couple of Perl
scripts to prepare Netlibrary records to upload into our catalog
server. Since then I've changed de
On Monday, February 26, 2007 11:38 AM, John D Thiesen wrote:
>This is presumably an obvious question to most of you, but where do I
>get MARC::Batch?
MARC::Batch is included as part of the MARC::Record distribution. Version
2.0.0 was recently (Jan. 25, 2007) released on CPAN:
This is presumably an obvious question to most of you, but where do I
get MARC::Batch? I used it about a year ago in a couple of Perl
scripts to prepare Netlibrary records to upload into our catalog
server. Since then I've changed desktop machines and I didn't find
MARC::Batch when
>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 Service
> as_string() could check if MARC::Descriptions is available, and if so add any
> available punctuation. If not, just do it the current way?
>
> I'm willing to tweak up MARC::Descriptions if someone can point me to a
> "proper punctuation" guide.
Then MARC::Record will be relying on MARC::
t the current way?
I'm willing to tweak up MARC::Descriptions if someone can point me to a
"proper punctuation" guide.
-David
On Wednesday 25 February 2004 09:26 am, Andy Lester wrote:
> > I'm using as_string() in Marc::Batch to get 650 fields and mash all the
>
> 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
>
>
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 g
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."
Ba
On Wed, Jan 14, 2004 at 09:59:49AM +, Stephen Graham wrote:
> It is in fact:
>
> MARC::Doc::Tutorial
Thanks Stephen, docfix applied :)
//Ed
use MARC::Batch;
my $batch = Marc::Batch('USMARC', 'file.dat');
You must be looking at the SYNOPSIS section for MARC::Batch? You are absolutely
right, it's a typo in the docs :(
Other parts of the documentation have the correct usage:
my $batch = MARC::Batch->ne
Fixed it right up! Thanks for the quick info...
Ed.
-Original Message-
From: Ed Summers [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 4:19 PM
To: [EMAIL PROTECTED]
Subject: Re: Problems with MARC::Batch
On Tue, Jan 13, 2004 at 04:11:17PM -0500, Sperr, Edwin wrote:
>
On Tue, Jan 13, 2004 at 04:11:17PM -0500, Sperr, Edwin wrote:
> use MARC::Batch;
> my $batch = Marc::Batch('USMARC', 'file.dat');
You must be looking at the SYNOPSIS section for MARC::Batch? You are absolutely
right, it's a typo in the docs :(
Other parts of the
> Undefined subroutine &Marc::Batch called at C:\MARCPERL\test1.pl line 6.
>
> ## create a MARC::Batch object.
> use MARC::Batch;
> my $batch = Marc::Batch('USMARC', 'file.dat');
It's MARC::Batch, not Marc::Batch. Perl is case-sensitive
Hi --
I'm trying to get MARC::Batch to work. To wit, when I try to use the
example script given in the documentation (or any other script that I've
tried), I get an error along the lines of:
Undefined subroutine &Marc::Batch called at C:\MARCPERL\test1.pl line 6.
Oddly enough, a
How should I handle MARC::Batch and diacritics?
I am in the process of creating a rudimentary index to my home book
collection. The index features:
* author, title, and subject browsable lists
* search result sorts by author, title, year, and rank
* preference settings
* a search
48 matches
Mail list logo