fv2xml - convert a Tie::FieldVals datafile into XML data.
This describes version 0.6202 of fv2xml.
fv2xml --help | --manpage | --version
fv2xml { --match field=pattern } [ --match_any pattern ] [ --num_recs num ] [ --start_rec num ] { --sort_by field } { --sort_numeric field } { --sort_reversed field } datafile [ outfile ]
This script converts a (subset of) a Tie::FieldVals datafile into XML data.
The input data file (in Tie::FieldVals format).
Print help message and exit.
Print the full help documentation (manual page) and exit.
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".
Extract a subset of records from the file by only including those which match the given pattern in any field.
Extract a subset of at most n records from the collection (it may be less).
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
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
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
Extract a subset of records starting from the nth record.
Print informational messages.
Print version information and exit.
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.
The format of the output XML file is as follows:
<fv_data> <record> <Field>Value</Field> <AnotherField>AnotherValue</AnotherField> ... </record> ... </fv_data>
Each field name is given its own tag, and the element contains the value for that field.
Getopt::Long Pod::Usage Getopt::ArgvFile Data::Dumper Tie::FieldVals Tie::FieldVals::Row Tie::FieldVals::Select
perl(1) Getopt::Long Getopt::ArgvFile Pod::Usage
Please report any bugs or feature requests to the author.
Kathryn Andersen (RUBYKAT) perlkat AT katspace dot com http://www.katspace.com
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.
To install Tie::FieldVals, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tie::FieldVals
CPAN shell
perl -MCPAN -e shell install Tie::FieldVals
For more information on module installation, please visit the detailed CPAN module installation guide.