| Palm-Progect documentation | view source | Contained in the Palm-Progect distribution. |
Palm::Progect::Converter::CSV - Convert between Progect databases and CSV files
my $converter = Palm::Progect::Converter->new(
format => 'CSV',
# ... other args ...
);
$converter->load_records();
# ... do stuff with records
$converter->save_records();
This converts between CSV files and Palm::Progect records and preferences.
The CSV format allows for basic import/export with spreadsheet programs.
The CSV file does not look like a tree structure; instead, there is a level
column, which indicates the indent level for the current row.
The columns in the format are:
The indent level of the record.
The priority of the record from 1 to 5, or 0 for no priority.
Any record can have one (and only one) of the above types.
If you are going to change the type of a record, remember to set all the other types to false:
isAction isProgress isNumeric isInfo
0 0 0 1
Completed has different values depending upon the type of record. For action items, it is either 1 or 0, for complete or not complete.
For Progress items, it is a number between 1 and 100, indicating a percentage.
For Numeric items it is a number between 1 and 100 indicating the
the integer percentage of the numericActual value divided by
the numericLimit value.
The numerator of a numeric record. If the numeric value of
a record is 4/5, then the numericActual value is 4.
The denominator of a numeric record. If the numeric value of
a record is 4/5, then the numericLimit value is 5.
This is a date in the format specified on the command line with the
--csv-date-format option
These options can be passed to the Palm::Progect::Converter constructor,
for instance:
my $converter = Palm::Progect::Converter->new(
format => 'CSV',
use_unix_eol => 1,
);
Use the given character as the csv separator (defaults to ;)
If true, use \r\n as the csv line terminator (the default)
If true, use \n as the csv line terminator
If true, use \r the csv line terminator
The format for dates: Any combination of dd, mm, yy, yyyy (default is dd/mm/yy).
Any dates that are printed will use this format. Dates that are parsed will be expected to be in this format.
Note that even though the command-line option is called csv-date-format,
when passed to Palm::Progect::Converter, the option is called date_format:
my $converter = Palm::Progect::Converter->new(
format => 'CSV',
date_format => 'mm-dd-yy',
);
Use the given character as the csv quote char (defaults to ")
Load CSV records from $file, translating them into the
internal Palm::Progect::Record format.
If $append is true then load_records will append the records
imported from $file to the internal records list. If false,
load_records will replace the internal records list with the
records imported from $file.
Export records in CSV format to $file.
If $append is true then load_records will append the CSV lines to
file. If false, export_records If false, export_records will
overwrite $file (if it exists) before writing the lines.
Michael Graham <mag-perl@occamstoothbrush.com>
Copyright (C) 2002-2005 Michael Graham. All rights reserved. This program is free software. You can use, modify, and distribute it under the same terms as Perl itself.
The latest version of this module can be found on http://www.occamstoothbrush.com/perl/
progconv
Palm::PDB(3)
http://progect.sourceforge.net/
| Palm-Progect documentation | view source | Contained in the Palm-Progect distribution. |