[Kst] Problem with CSV files
syntheticpp at gmx.net
Fri Nov 1 08:12:20 UTC 2013
On 01.11.2013 03:29, Syam wrote:
> On 01-Nov-2013 3:31 AM, "Alexander Semke" <Alexander.Semke at web.de> wrote:
>>> How could we change it, so it also detects empty columns?
>> In labplot2 we use QString::split with QString::SkipEmptyParts to split
>> line we read into its parts. By doing so with this file, we end up with
>> 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.
Seems it is a corner case of this bug:
so we don't have to change the column-detection code ;)
The bug was fixed by this:
I pushed a patch, which removes the assumption, that the row always starts with a number.
Please check if it works for you now.
More information about the Kst