fanumerical tags is the same
as simple filing.
I do not know if the idea behind MARC::Record is that it should be extendable to cover
for other MARC dialects.
Even if it, as it stands, only is intended for MARC21 records, I still think it would
be nice to have an insert method like the one a
Am I missing something?
I can not find this in MARC::Record
Leif
-Ursprungligt meddelande-
Från: Ed Summers [mailto:[EMAIL PROTECTED]
Skickat: den 5 november 2003 19:58
Till: [EMAIL PROTECTED]
Ämne: Re: MARC::Record insert function
On Wed, Nov 05, 2003 at 07:29:59PM +0100, Leif
valid record in this context?"
The answer would be, I'd guess, if we can perform other methods on the object it is a
"valid" record (so far).
Leif
==
Leif Andersson, Systems Librarian
Stockholm University Library
SE-106 91 Stockholm
SWEDEN
Phone : +46 8 162769
Mobile: +46 70 6904281
subfields = eval { $record->field('035')->subfield('a') };
Leif
-Ursprungligt meddelande-
Från: Paul Hoffman [mailto:[EMAIL PROTECTED]
Skickat: den 6 november 2003 22:30
Till: Leif Andersson
Kopia: [EMAIL PROTECTED]
Ämne: Re: Return values from MARC::Record
On
some extra work to the subfield() method we can also do this
$subfield = $record->subfield('035','a');
@subfields = $record->subfield('035','a');
print "subfield=$subfield\n";
print "[EMAIL PROTECTED]";
__END__
And it shouldn'
to do.
Maybe I should add that I like MARC::Record - that's why I am doing this in the first
place.
I also appreciated your idiomatic code-arounds, even though it was not my primarily
concern.
Leif
==
Leif Andersson, Systems Librarian
Stockholm University Libr
o put the allowence of letters in...)
Leif
==
Leif Andersson, Systems Librarian
Stockholm University Library
SE-106 91 Stockholm
SWEDEN
Phone : +46 8 162769
Mobile: +46 70 6904281
I think there are some problems with your code.
First, a number of typos, so it won't compile.
Second, if $tagnumber is a repeatable field you will only fix the first one.
You would have to do something like this instead:
my @existing_fields = $record->field($tagnumber);
And then loop through the
It appears to be deceptive values in leader pos 12-16, which is supposed to point to
the beginning of data.
MARC::Record relies on this value.
I do not know, though, if this is a sign of a different MARC flavour, or if something
bad has happened to the record.
If it is in accordance with a spec
And I am sure some guys will be more happy with a capital F in France.
Leif
==
Leif Andersson, Systems Librarian
Stockholm University Library
SE-106 91 Stockholm
SWEDEN
Phone : +46 8 162769
Mobile: +46 70 6904281
-Ursprungligt meddelande-
Från
This is one way to do it:
#!/usr/local/bin/perl -w
use strict;
use MARC::Batch;
# sort marc records on field 001
# usage: sort_marc.pl infil.mrc > utfil.mrc
my $batch = new MARC::Batch( 'USMARC', $ARGV[0] );
my @records = ();
my @f001= ();
my $idx = 0;
while ( my $MARC = $batch->next
I am sorry, my earlier posting contained a little error.
The last print statement should read
print $records[$rec->[0]]->as_usmarc();
Jackie also pointed out that his 001 is alphanumeric.
So he changed the comparision operator from "<=>" (numeric) to "cmp"
The script should have looked
rk, but I am interested in how others would address the same
problem.
Leif
======
Leif Andersson, Systems Librarian
Stockholm University Library
lc($_->{_tag})] } @{$record->{_fields}};
If field "500" had not been assigned a sort key, we would see that field
erroneously sort before any other 5XX field.
To prevent that we could add a definition for 500 as the last one
i.e. "500" => "500"
gt;delete_subfield( code => $code, # of course
occur => [0,2,3], # "occur" or "pos" or whatever...
match => qr/pat/, # doesn't need to be repeatable
);
Leif
====
seem to recall someone on this list mentioning the path MARC Record (MARC8)
-> MARCXML (UTF8) -> MARC Record (UTF8)
This trip involves, I'd guess, MARC::File::XML in addition to MARC::Charset
But I suspect there may be different approaches here.
Leif
introduce a "sloppy mode" switch?
Leif
======
Leif Andersson, Systems Librarian
Stockholm University Library
SE-106 91 Stockholm
SWEDEN
Phone : +46 8 162769
Mobile: +46 70 6904281
-Ursprungligt meddelande-
Från: Mike Rylander [mailto:[EMAIL PROTECTED]
Skickat: den 26 januar
ource]',
);
my $field = $record->field('245');
my $revised_245 = MARC::Field->new('245', '', '', @a245);
$field->replace_with($revised_245);
Leif Andersson
-Ursprungligt meddelande-
Från: Merritt H Lennox [mailto:[EMAIL
Jacobien,
Try this:
my $blob = $record->as_usmarc();
$blob= $dbh->quote($blob);
And load $blob as you did before.
Leif
==
Leif Andersson, Systems Librarian
Stockholm University Library
SE-106 91 Stockholm
SWEDEN
the record as_usmarc() ?
If not I suggest this change be made to a future release of MARC::Record.
I shall also add that this character mess only sets in when doing IO.
If you are updating your databases through one API or another you are probably
OK!
Leif
===
ce the faulty behaviour we can have a
deeper look into it.
Leif
==
Leif Andersson, Systems Librarian
Stockholm University Library
SE-106 91 Stockholm
SWEDEN
Phone : +46 8 162769
Mobile: +46 70 6904281
-Ursprungligt meddelande-
Från: Doran, Michael D
ating the use of
Locale::Maketext::Lexicon
Probably too demanding for smaller projects, but still interesting.
There is always a balance between how much work to spend on solving a problem,
how flexible and scalable it has to be, if we like avoiding installing extra
modules etc etc...
Leif
Leif
==
Leif Andersson, Systems Librarian
Stockholm University Library
SE-106 91 Stockholm
SWEDEN
Phone : +46 8 162769
Mobile: +46 70 6904281
-Ursprungligt meddelande-
Från: Doran, Michael D [mailto:[EMAIL PROTECTED]
Skickat: den 6 maj 2008 04:13
Till: Mike Ryl
h = new MARC::Batch('USMARC', $ARGV[0]);
$batch->strict_off ();
$batch->warnings_off ();
#binmode( STDOUT, ':raw' );
#binmode STDOUT;
my $record = $batch->next;
print $record->as_usmarc;
As a habit I use
binmode FH;
when I write records to file.
It is not nee
Leif,
Is the downside to this approach that you are modifying a CPAN module
in place, or is it something to do with the behavior of 'use bytes'?
Would there be any undesirable side effects to adding 'use bytes' to
MARC::File::USMARC::encode on CPAN?
//Ed
On Tue, Oct 12, 201
___
Från: Al [ra...@berkeley.edu]
Skickat: den 12 oktober 2010 17:45
Till: Leif Andersson; perl4lib@perl.org
Ämne: Re: MARC-perl: different versions yield different results
Thanks, that does indeed do the trick.
>MARC::Record 2.0.0, the so called unicode version,
m not sure my brute hack qualifies as a one.
But for now I will leave that up to others to decide.
/Leif
Från: Galen Charlton [gmcha...@gmail.com]
Skickat: den 12 oktober 2010 17:35
Till: Leif Andersson
Kopia: Al; perl4lib@perl.org
Ämne: Re: MARC-perl: diff
Frédéric,
Just out of curiosity - what was your main motivation for writing another MARC
module?
In what ways does your distribution differ from MARC::Record?
/Leif
Hi Michael,
this is how I - in principle - usually do it:
use MARC::Record;
...
my $record = MARC::Record->new_from_usmarc( $blob );
/Leif
Leif Andersson, Systems librarian
Stockholm University Library
Från: Doran, Michael D [do...@uta.edu]
Skickat:
$len = substr($marc,0,5);
return substr($marc,0,$len);
}
else {
$_[0]->{'eof'} = 1;
return undef;
}
}
sub EOF {
# eof()
$_[0]->{'eof'};
}
sub FILENO {1}
sub BINMODE {1}
sub CLOSE {1}
sub DESTROY {1}
__END__
That's all folks,
I am not sure I really got this.
Because if I did:
- The error messages in your orig posting were not the exact error messages.
- The original posted code was not the actual code producing the errors
- And the sample MARC records, supplied to demonstrate the errors, were
actually OK
Sometimes y
This is a fine little piece of programming. (And useful too)
I wished my own code looked this nice and clean!
/Leif Andersson
Stockholm University Library
Från: Stefano Bargioni [bargi...@pusc.it]
Skickat: den 13 december 2011 12:37
Till: perl4lib
Ämne
It gunzips fine, but then there seems to be something wrong with the tar file...
/Leif Andersson
Stockholm University Library
uari 2013 20:01
Till: Leif Andersson
Kopia: perl4lib
Ämne: Re: MARC::Charset 1.34
Hi,
On Mon, Feb 11, 2013 at 10:50 AM, Leif Andersson
mailto:leif.anders...@sub.su.se>> wrote:
It gunzips fine, but then there seems to be something wrong with the tar file...
Could you elaborate? In particul
Ah, I still had one of those bad archives left.
So I could see that the file size differed.
The bad .tar.gz was 182.056 bytes
The good 191.865
And after unzipping the corrupt file I got a .tar file of size 191.865 !
gzipped twice?
Well, I renamed the unzipped corrupt .tar file to .tar.gz
And now
Hi Eric,
my first guess would be your terminal is not utf8.
If you comment out
#binmode( STDOUT, ":utf8" );
and that does the trick, then you can start looking for how to change your
terminal settings.
(And that can sometimes be a rather frustrating task, I'm afraid)
/Leif Ande
36 matches
Mail list logo