[Kst] Problem with CSV files

Peter Kümmel syntheticpp at gmx.net
Thu Oct 31 09:21:59 UTC 2013


On 30.10.2013 04:03, Syam Krishnan wrote:
> Hi
>
> I have a CSV file generated by an Oscilloscope device and I tried to open that
> in Kst (latest git snapshot) but the vectors are not recognized properly.
> The file contains 16 lines of meta-data followed by comma separated records in
> each line.
>
> The data lines are as follows:
>
> ,-1.6667E-03, 2.5150E+00,
> , 1.6667E-03, 2.5183E+00,
> ,-1.6667E-03, 2.5150E+00,
> , 1.6667E-03, 2.5183E+00,
> ,-1.6667E-03, 2.5150E+00,
> ,-1.6667E-02, 2.5150E+00,
> , 1.6667E-03, 2.5183E+00,
> , 1.6667E-03, 2.5150E+00,
> ...
>
> While importing with Kst, I choose 'Data starts at line 17' and set comma
> character as the custom delimiter.
> Kst then lists two columns - Column1 & Column2 and I select them to be plotted
> against INDEX.
>
> The plot appears and while both Column1 & Column2 curves are listed, only
> Column2 seems to be visible.
> Using the 'View vectors' dialog, I see that Coulmn1 vector only has 'nan' while
> Column2 is actually the first parameter of my data.
>
>
> I'm attaching the first few lines of the CSV file as test data. Could you please
> look in to this problem.
>

Kst has problems with the empty column at the beginning.
Currently we use this regex to detect the number of columns: ^[,]*[#].*

How could we change it, so it also detects empty columns?

I'm not familiar with regexs:
http://doc-snapshot.qt-project.org/4.8/qregexp.html#details

Peter





More information about the Kst mailing list