Bug 243405 - import does not parse csv files correctly - skips empty fields
Summary: import does not parse csv files correctly - skips empty fields
Status: RESOLVED WORKSFORME
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 05:27 UTC by John Gutierrez
Modified: 2010-07-05 14:18 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test CSV File (627 bytes, text/plain)
2010-07-05 10:59 UTC, John Gutierrez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Gutierrez 2010-07-02 05:27:37 UTC
Version:           unspecified (using Devel) 
OS:                Linux

Even though the first line contains data in all fields, the following data lines have empty fields deleted so data is moved to the left.
Does not correctly parse the first line if it contains an empty field (empty fields are ignored).

Reproducible: Always

Steps to Reproduce:
Try to import a csv file where the first line contains data in all fields with follwing data having some empty fields.

Try to import a csv file where the first line does not contain data in all fields followed by data which have some empty fields.

Actual Results:  
The imported files have data in all the places.

Expected Results:  
flawless csv import.
Comment 1 Tobias Koenig 2010-07-03 22:48:01 UTC
Hej,

can you attach an example document, please?

Ciao,
Tobias
Comment 2 John Gutierrez 2010-07-05 10:59:53 UTC
Created attachment 48601 [details]
Test CSV File

The fields are not quoted.  The delimiter is a semi-colon.  The first record describes the fields (to be ignored)
Comment 3 John Gutierrez 2010-07-05 11:25:33 UTC
On Saturday July 3 2010 01:48:02 pm Tobias Koenig wrote:

> https://bugs.kde.org/show_bug.cgi?id=243405
> 
> 
> Tobias Koenig <tokoe@kde.org> changed:
> 
>            What    |Removed                     |Added
> -------------------------------------------------------------------------
> --- Status|UNCONFIRMED                 |NEEDSINFO
>          Resolution|                            |WAITINGFORINFO
>            Severity|major                       |normal
> 
> 
> 
> 
> --- Comment #1 from Tobias Koenig <tokoe kde org>  2010-07-03 22:48:01
> --- Hej,
> 
> can you attach an example document, please?
> 
> Ciao,
> Tobias

Tobias,

I've uploaded the attached file  to my bug report.  It is an unquoted, semi-
colon delimited file.  The first row shows the fields; not to be imported.

I don't especially like the parser's handling of the import data.  I want 
"Juan & Lisa" as the "Given_Name".  I noticed that it imports "Dr. Norma" as 
the 'Given_Name", but  and handles "Juan & Lisa"  by showning "& Lisa" as an 
"Additional Name".  "David John" is handled as Given and Additional.

The name field in the entry screen does not even show Given, Family, 
Additional, Honorary Prefix/Suffix.  I don't feel that a parser is a good 
idea in this case.  It also limits what I have been doing with the 'older 
version".

I also noticed (separate bug) that the migration tool brought in 
"Anniversary" and shows in the vcf file a "Kaddressbook" defined field and 
shows up when exporting to a CSV file.  The migration tool also brought in 
the "Blog" field as a defined field, but DOES NOT show up when exporting to 
csv!  Inconsistency tends to drive me nuts.  I want all of the fields shown 
in the vcf file, otherwise I am missing data.

John G.
Comment 4 Tobias Koenig 2010-07-05 14:18:51 UTC
Hej,

can't reproduce it here with the file you send under latest development version.
The empty fields are shown correctly in the import dialog and the contacts are imported
correctly as well.

Ciao,
Tobias