fractureMech,
Ok - I don't own a Palm Pilot, but I think this will work. With statements from the
POD like
"I don't know what these are.", I have to agree with your assesment of the documentation. You might also want to take a look at
pdbdump which comes with
the p5-Palm-1.3.0 suite
#!/usr/bin/perl -w
use strict;
use Text::CSV;
use Palm::PDB;
use Palm::Address;
my $pdb = new Palm::PDB;
$pdb->Load("myfile.pdb") or die "Unable to attach to address book";
my $csv = Text::CSV->new();
my @order = qw(
name firstName company phone1 phone2
phone3 phone4 phone5 address city
state zipCode country title custom1
custom2 custom3 custom4 note
);
open (OUTPUT, ">address.csv") or die "Unable to open output file : $!"
+;
select OUTPUT;
for my $record (@{$pdb->{records}}) {
my @output;
for my $field (@order) {
if (exists $record->{fields}{$field}) {
push @output, $record->{fields}{$field};
}
else {
push @output, '';
}
}
if ($csv->combine(@output)) {
my $string = $csv->string;
print $string, "\n";
}
else {
my $err = $csv->error_input;
print STDOUT "combine() failed on argument: ", $err, "\n";
}
}
Cheers and I hope it helps - L~R
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.