[Kst] Problem with CSV files
Syam
syamcr at gmail.com
Fri Nov 1 02:29:27 UTC 2013
On 01-Nov-2013 3:31 AM, "Alexander Semke" <Alexander.Semke at web.de> wrote:
>
> Hi,
>
> > How could we change it, so it also detects empty columns?
> In labplot2 we use QString::split with QString::SkipEmptyParts to split
each
> line we read into its parts. By doing so with this file, we end up with
two
> valid columns.
I've gone through the code for tracking this issue. So far, I think Kst
uses SkipEmptyParts while identifying columns so that only two columns are
listed. But while reading data from each line, it uses a different method
than QString::split. It scans for the separator character and converts each
token to a double value. Here, the initial comma causes a problem as the
code doesn't skip blank fields.
I think we should have the same logic for recognising columns and while
reading data. What if we use KeepEmptyParts while scanning for columns? I
believe things will then work fine even if lines have missing fields.
Syam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kst/attachments/20131101/6a8481be/attachment.html>
More information about the Kst
mailing list