[Tickets #2742] NEW: Addressbook import fails with CSVs with newlines
bugs@bugs.horde.org
bugs at bugs.horde.org
Thu Oct 6 13:20:34 PDT 2005
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/?id=2742
-----------------------------------------------------------------------
Ticket | 2742
Created By | horde at apocalyptech.com
Summary | Addressbook import fails with CSVs with newlines
Queue | Turba
Version | 2.0.3
State | Unconfirmed
Priority | 1. Low
Type | Bug
Owners |
-----------------------------------------------------------------------
horde at apocalyptech.com (2005-10-06 13:20) wrote:
If a field in a CSV file to be imported contains newlines (even when 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
More information about the bugs
mailing list