RE: sending marc records into a script that uses MARC::Batch

2014-06-03 Thread John E Guillory
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

Re: sending marc records into a script that uses MARC::Batch

2014-05-30 Thread Timothy Prettyman
:* 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’,); > > >

Re: sending marc records into a script that uses MARC::Batch

2014-05-30 Thread Stefano Bargioni
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

Re: sending marc records into a script that uses MARC::Batch

2014-05-29 Thread Robin Sheat
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

RE: sending marc records into a script that uses MARC::Batch

2014-05-29 Thread John E Guillory
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

Re: sending marc records into a script that uses MARC::Batch

2014-05-29 Thread Timothy Prettyman
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

sending marc records into a script that uses MARC::Batch

2014-05-29 Thread John E Guillory
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()) { ...

Re: reading and writing of utf-8 with marc::batch [resolved; gigo]

2013-03-28 Thread Eric Lease Morgan
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, &

Re: reading and writing of utf-8 with marc::batch [double encoding]

2013-03-28 Thread Ashley Sanders
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

Re: reading and writing of utf-8 with marc::batch [double encoding]

2013-03-27 Thread Galen Charlton
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 >

Re: reading and writing of utf-8 with marc::batch [double encoding]

2013-03-27 Thread Shelley Doljack
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

Re: reading and writing of utf-8 with marc::batch [double encoding]

2013-03-27 Thread Eric Lease Morgan
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

Re: reading and writing of utf-8 with marc::batch [double encoding]

2013-03-27 Thread Eric Lease Morgan
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

Re: reading and writing of utf-8 with marc::batch [double encoding]

2013-03-27 Thread Galen Charlton
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

Re: reading and writing of utf-8 with marc::batch [double encoding]

2013-03-27 Thread Eric Lease Morgan
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

Re: reading and writing of utf-8 with marc::batch

2013-03-27 Thread Shelley Doljack
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

Re: reading and writing of utf-8 with marc::batch [terminal]

2013-03-27 Thread Galen Charlton
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

Re: reading and writing of utf-8 with marc::batch [terminal]

2013-03-27 Thread Eric Lease Morgan
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

Re: reading and writing of utf-8 with marc::batch

2013-03-27 Thread Galen Charlton
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

Re: reading and writing of utf-8 with marc::batch

2013-03-27 Thread Jon Gorman
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&

RE: reading and writing of utf-8 with marc::batch

2013-03-27 Thread KREYCHE, MICHAEL
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, >

FW: reading and writing of utf-8 with marc::batch

2013-03-27 Thread Brown, Alan
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

Re: reading and writing of utf-8 with marc::batch

2013-03-26 Thread Leif Andersson
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

Re: reading and writing of utf-8 with marc::batch

2013-03-26 Thread Timothy Prettyman
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

Re: reading and writing of utf-8 with marc::batch

2013-03-26 Thread Paul Hoffman
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

reading and writing of utf-8 with marc::batch

2013-03-26 Thread Eric Lease Morgan
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

RE: MARC::Batch question

2011-10-14 Thread Zhang, Bin
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

Re: MARC::Batch question

2011-10-14 Thread arvinport...@lycos.com
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,

Re: MARC::Batch question

2011-10-14 Thread Jonathan Druart
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,

RE: MARC::Batch question

2011-10-14 Thread PHILLIPS M.E.
> 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

MARC::Batch question

2011-10-13 Thread 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 can't seem to find a way to skip an error record. When I ran the following against an

Problems with MARC::Batch strict_off

2007-08-13 Thread Andy Kohler
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

Re: MARC::Batch

2007-02-26 Thread Edward Summers
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

RE: MARC::Batch

2007-02-26 Thread Bryan Baldus
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:

MARC::Batch

2007-02-26 Thread John D Thiesen
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

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 Service

Re: Using as_string() in Marc::batch

2004-02-25 Thread Andy Lester
> 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::

Re: Using as_string() in Marc::batch

2004-02-25 Thread David Christensen
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 >

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 > >

RE: Using as_string() in Marc::batch

2004-02-25 Thread Holly Bravender
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

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." Ba

Re: Problems with MARC::Batch

2004-01-14 Thread Ed Summers
On Wed, Jan 14, 2004 at 09:59:49AM +, Stephen Graham wrote: > It is in fact: > > MARC::Doc::Tutorial Thanks Stephen, docfix applied :) //Ed

Re: Problems with MARC::Batch

2004-01-14 Thread Stephen Graham
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

RE: Problems with MARC::Batch

2004-01-13 Thread Sperr, Edwin
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: >

Re: Problems with MARC::Batch

2004-01-13 Thread Ed Summers
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

Re: Problems with MARC::Batch

2004-01-13 Thread Andy Lester
> 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

Problems with MARC::Batch

2004-01-13 Thread Sperr, Edwin
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

MARC::Batch and diacritics

2003-12-15 Thread Eric Lease Morgan
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