Looking for help!
NAME
fv2sqlite - import a Tie::FieldVals datafile into an SQLite database.
VERSION
This describes version 0.61 of fv2sqlite.
SYNOPSIS
fv2sqlite --help | --manpage | --version
fv2sqlite { --match field=pattern } [ --match_any pattern ] [ --num_recs num ] [ --start_rec num ] { --sort_by field } { --sort_numeric field } { --sort_reversed field } --datafile datafile --sqlitedb dbfile --table table
DESCRIPTION
This script inserts a (subset of) a Tie::FieldVals datafile into a table in an SQLite database. The table and the database must have already been created.
OPTIONS
- --datafile filename
-
The input data file (in Tie::FieldVals format).
- --help
-
Print help message and exit.
- --manpage
-
Print the full help documentation (manual page) and exit.
- --match field=pattern
-
Extract a subset of records from the file, by only including those which match the given pattern for the given field. This option can be repeated for multiple fields. For example:
--match Author=Mary
will give the records for authors which contain the string "Mary".
- --match_any pattern
-
Extract a subset of records from the file by only including those which match the given pattern in any field.
- --num_recs n
-
Extract a subset of at most n records from the collection (it may be less).
- --sort_by field
-
Sort by this field. Can be repeated to sort by multiple fields. Thus, if one wished to sort by Author and then Title, one would give:
--sort_by Author --sort_by Title
- --sort_numeric field
-
If sorting by this field, use this to alter the type of the sort, to make it numeric.
For example:
--sort_by SeriesOrder --sort_numeric SeriesOrder
To switch off numeric sort for a field, give the value of 0 to the argument.
For example: --sort_by SeriesOrder --sort_numeric SeriesOrder=0
- --sort_reversed field
-
If sorting by this field, use this to alter the direction of the sort, to make it sort reversed.
For example: --sort_by Author --sort_reversed Author
To switch off reversed sort for a field, give the value of 0 to the argument.
For example: --sort_by Author --sort_reversed Author=0
- --start_rec n
-
Extract a subset of records starting from the nth record.
- --verbose
-
Print informational messages.
- --version
-
Print version information and exit.
CONVERSION
FieldVals Format
The input data file is in the form of Field:Value pairs, with each record separated by a line with '=' on it.
See "FILE FORMAT" in Tie::FieldVals for more information.
SQLite
This script expects both the SQLite database and the destination table to have already been created. The table is expected to have the same column names as the fields in the FieldVals file.
REQUIRES
Getopt::Long
Pod::Usage
Getopt::ArgvFile
SQLite::Work
Tie::FieldVals
Tie::FieldVals::Row
Tie::FieldVals::Select
SEE ALSO
perl(1) Getopt::Long Getopt::ArgvFile Pod::Usage
BUGS
Please report any bugs or feature requests to the author.
AUTHOR
Kathryn Andersen (RUBYKAT)
perlkat AT katspace dot com
http://www.katspace.com
COPYRIGHT AND LICENCE
Copyright (c) 2004 by Kathryn Andersen
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.