[koha-Infos] Import UNIMARC
Julien Berard
julien.berard at probesys.com
Mar 28 Oct 15:45:44 CET 2008
Julien Berard a écrit :
> paul POULAIN a écrit :
>
>> Julien Berard a écrit :
>>
>>
>>> Concernant marcdump je ne le trouve pas non plus, pourtant dans la doc
>>> de koha ils parlent bien d'un dumpmarc.pl
>>>
>>> http://www.kohadocs.org/migrer_ses_donnees.html#d0e280
>>>
>>>
>>> Je vais donc une erreur au niveau de koha?
>>>
>>>
>>>
>> non, mais ca c'est un truc qui date de koha 2.2
>> Depuis, marcdump a été ajouté dans une des bibliothèques (yaz ?)
>> qu'utilise Koha, donc on n'a plus besoin de dumpmarc.pl, et il a disparu
>> de Koha lui-même.
>>
>>
>>
> Merci ;-).
>
> ****************A propos de mon script*************
>
> J'ai simplement repris un exemple de la doc pour la librairie qui crée
> du marc.
>
>
> Le script donne ca -->
>
> #!/usr/bin/perl
> ## Example W1
>
> ## create a MARC::Record object.
> use MARC::Record;
> my $record = MARC::Record->new();
>
> ## add the leader to the record. optional.
> $record->leader('00903pam 2200265 a 4500');
>
> ## create an author field.
> my $author = MARC::Field->new(
> '100',1,'',
> a => 'Logan, Robert K.',
> d => '1939-'
> );
>
> ## create a title field.
> my $title = MARC::Field->new(
> '200','1','4',
> a => 'The alphabet effect /',
> c => 'Robert K. Logan.'
> );
>
> $record->append_fields($author, $title);
>
> ## open a filehandle to write to 'record.dat'.
> open(OUTPUT, '> record.dat') or die $!;
> print OUTPUT $record->as_usmarc();
> close(OUTPUT);
>
>
> Ce qui me crée un fichier record.dat en format marc.
>
> Si je fais un yaz-marcdump -v record.dat
>
> J'ai un :
>
> julienb at julien:~/mnei$ yaz-marcdump -v record.dat
> (Record length 122)
> (Indicator length 2)
> (Identifier length 2)
> (Base address 49)
> (Length data entry 4)
> (Length starting 5)
> (Length implementation 0)
> 00122pam 220004965 4500
> (Directory offset 24: Tag 001)
> (Directory offset 36: Tag 002)
> (Directory offset 48: Tag 28)
> (Directory offset 48: Bad value for data length and/or length starting)
>
>
> D'apres vous quel est le probleme?
>
>
Message plus explicite avec marcdump :
julienb at julien:~/mnei$ marcdump record.dat
record.dat
substr outside of string at /usr/share/perl/5.10/bytes_heavy.pl line 11.
Use of uninitialized value $_[0] in length at
/usr/share/perl/5.10/bytes_heavy.pl line 5.
Use of uninitialized value $tagdata in substr at
/usr/local/share/perl/5.10.0/MARC/File/USMARC.pm line 177.
substr outside of string at /usr/share/perl/5.10/bytes_heavy.pl line 11.
Use of uninitialized value $_[0] in length at
/usr/share/perl/5.10/bytes_heavy.pl line 5.
Use of uninitialized value $tagdata in substr at
/usr/local/share/perl/5.10.0/MARC/File/USMARC.pm line 177.
Use of uninitialized value in sprintf at
/usr/local/share/perl/5.10.0/MARC/Field.pm line 484.
Use of uninitialized value in sprintf at
/usr/local/share/perl/5.10.0/MARC/Field.pm line 484.
LDR 00122pam 220004965 4500
001
002
Recs Errs Filename
----- ----- --------
1 1 record.dat
--
Cordialement,
Julien Bérard
probeSys spécialist GNU/Linux
Tèl: 08-74-76-47-86
Plus d'informations sur la liste de diffusion Infos