Summary | Addressbook import fails with CSVs with newlines |
Queue | Turba |
Queue Version | 2.0.3 |
Type | Bug |
State | Not A Bug |
Priority | 1. Low |
Owners | |
Requester | horde (at) apocalyptech (dot) com |
Created | 10/06/2005 (7185 days ago) |
Due | |
Updated | 10/06/2005 (7185 days ago) |
Assigned | 10/06/2005 (7185 days ago) |
Resolved | 10/06/2005 (7185 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Thanks again!
bit behind the 1.2.2 available @ pear.php.net. I'll try an upgrade.
I *do* see a File/CSV.php in there, though, so perhaps it's just an
old Pear bug. I'll let you know, thanks...
State ⇒ Feedback
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Addressbook import fails with CSVs with newlines
Queue ⇒ Turba
they're enclosed inside quote characters), Turba won't import that
row, and will generate a warning on the screen like so:
Warning: Read wrong fields number count: '78' expected 92 in
/usr/local/www/mod_php/lib/php/PEAR.php on line 842
Warning: Read wrong fields number count: '1' expected 92 in
/usr/local/www/mod_php/lib/php/PEAR.php on line 842
Warning: Read wrong fields number count: '1' expected 92 in
/usr/local/www/mod_php/lib/php/PEAR.php on line 842
Warning: Read wrong fields number count: '3' expected 92 in
/usr/local/www/mod_php/lib/php/PEAR.php on line 842
In this case, the CSV is from an export of an Outlook 2003 "XP"
addressbook, and the 79th column (out of 92) is a "Notes" column which
happens to have some newlines in it. As you can see, it grabs the
first 78 columns and then tries to process each line of the continued
Notes field as a new addressbook entry. Looking at the file itself,
the entry snippet looks something like:
...... "foo","bar","baz","Here's
some
data:
Saturday, September 21, 2002 11:02 PM
etc","frob",.....
As you can see, the newlines are enclosed inside the quote character
(which I had specified on the first screen of the address book import).
The most obvious response would, of course, be simply "Don't Do That,"
but unfortunately Outlook apparently doesn't have any options which
would let you exclude the Notes field, or fields with newlines, etc,
and so fixing the file from the user's perspective becomes a matter of
opening the file in a spreadsheet app and pruning out troublesome
columns, which simply isn't something you could ask of a larger,
fairly computer-illiterate userbase.
I'll see if I can look at patching it up myself in a bit, figured I'd
put this here for posterity now though. Thanks!
-CJ