The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

picaimport - Import or delete PICA+ records in a PICA::Store

VERSION

version 0.585

SYNOPSIS

  picaimport [options] [file]*

OPTIONS

 -help          this brief help message
 -man           show detailed documentation with examples
 -config FILE   read configuration from a file (default: picastore.conf)
 -delete        delete records instead of importing them
 -force         do not ask before deleting
 -from FILE     read files to import from a file (default: - for STDIN)
 -get           download records instead of uploading (implies -write)
 -move          remove imported files on success
 -log FILE      print import information to a file (default: - for STDIN)
 -quiet         suppress additional status messages and output
 -ppn           update with the PPN of a record if no PPN is given
 -version       print version of this script and exit
 -write         write back the resulting record

DESCRIPTION

This script can be used to import or delete PICA records in a PICA::Store, for instance via webcat (PICA::SOAPClient) or into a SQLite database (PICA::SQLiteStore). By default only the first PICA record of each file that you specify is imported.

The PICA+ files to be imported can be specified either as command line parameters or listed in another file (option -from) or you type in the file names on request. It is recommended to delete sucessfully imported files (with option -move) so you do not import them twice. If options are read from another file, you must specify PPN and filename seperated by space (update) or just a filename on each line. To update via command line you must specify a PPN (with option -ppn) and a record file or state with option -update that the PPN is taken from the record.

On import or update picaimport prints the PPN and filename of each record in one line - you can use this output format as input format with option -from to later update the records.

To connect to a PICA store you must provide a config file via the -config parameter or the PICASTORE environment variable - or name it picastore.conf and put it in the current directory. The config file can contain all parameters that may be provided to the PICA::Store constructor. At least there must be one of the following parameters:

  webcat = URL
  SQLite = FILE

Other known configuration parameters include dbsid, userkey, password, and language.

EXAMPLES

Import the first PICA+ record in myrecord.pica to the store specified in the default configuration file (picastore.conf).

  picaimport myrecord.pica

Update record 000073067 in the store specified in the default configuration file with the first PICA+ record in myrecord.pica.

  picaimport -conf mydb.conf 000073067=title1.pica

Get the record 000073067 from the default store and write it to down.pica

  picaimport -get 000073067=down.pica

Import the first PICA+ record in myrecord.pica to the default store and write back the resulting record to myrecord.pica.

  picaimport -write myrecord.pica

Import all files listed in newrecords and delete imported files on success

  picaimport -from newrecords -move

AUTHOR

Jakob Voß <voss@gbv.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Verbundzentrale Goettingen (VZG) and Jakob Voss.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.