Bug 121049

Summary: Tabular data imported as 0
Product: [Applications] kst Reporter: Toni <toni>
Component: datasourcesAssignee: kst
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Toni 2006-01-30 17:59:53 UTC
Version:           1.1.0_beta2 (using KDE 3.3.2,  (3.1))
Compiler:          gcc version 3.3.6 (Debian 1:3.3.6-5)
OS:                Linux (i686) release 2.6.12-1-k7

Columns 3,5 and 7 in the following data file are plotted as zeroes. 

+123.07672 Pitch1 -100.98595 Roll1 -103.77522 Error1 +000.01443
+123.39128 Pitch1 -100.79884 Roll1 -103.59789 Error1 +000.01497
+122.77023 Pitch1 -100.98871 Roll1 -103.72810 Error1 +000.01441
+122.73686 Pitch1 -101.06622 Roll1 -103.86769 Error1 +000.01405
+122.95135 Pitch1 -101.02708 Roll1 -103.78849 Error1 +000.01430
+122.68306 Pitch1 -100.97473 Roll1 -103.73014 Error1 +000.01426
+122.89673 Pitch1 -101.05804 Roll1 -103.83449 Error1 +000.01494
+123.53746 Pitch1 -100.68370 Roll1 -103.60576 Error1 +000.01405
+122.99809 Pitch1 -100.82896 Roll1 -103.71476 Error1 +000.01387
+123.26770 Pitch1 -100.88278 Roll1 -103.69803 Error1 +000.01443
Comment 1 George Staikos 2006-01-30 18:32:33 UTC
We shouldn't error out the whole thing on a bad column
Comment 2 Toni 2006-01-31 10:30:41 UTC
Oddly, the following works fine (columns 1,2,4,6 imported ok):

+123.07672 -100.98595 Roll1 -103.77522 Error1 +000.01443 
+123.39128 -100.79884 Roll1 -103.59789 Error1 +000.01497 
Comment 3 Matthew Truch 2006-01-31 12:08:18 UTC
This took a while for me to track down, as it was not what I (nor George) thought.  

Kst is seeing the 'c' in Pitch1, and interpreting the rest of the line as a comment.  Toni, for you to make this work, start kst, click on Settings->Configure Kst.  Click on the Data Sources tab.  Select the ASCII File Reader, and click on Configure.  Remove the 'c' from the list of comment delimitors (and make any other changes you want).  Apply.  Now all should be well.  

Perhaps 'c' isn't a good choice for one of the default comment delimitors.  Personally, I'd vote for just '#'.  And maybe ';'.
Comment 4 Nicolas Brisset 2006-01-31 12:54:41 UTC
I remember this problem from the time I looked at ASCII configuration options (I even thought there was a comment in the code I wrote to warn about this, but it seems to be gone now...) 
The question is actually: is it wise to ignore the rest of a line just because there is somewhere a character listed in the comment indicators ? Couldn't we just ignore that particular column ? 
I'm also curious about fixed-width columns (like 16 characters): the way it used to be, the "bad" columns could just be ignored as the offset to read from can be computed directly and we don't have to parse the whole line... No time to check this now, though... However, it could be an alternative as it's pretty easy to reformat an ASCII file with fixed-width columns with awk/python/etc...

All in all, for the short term and considering other more important changes to be made, I'd say that making the default comment indicator only "#" would be the right way to go. I think ";" is very widely used (.csv files often have those) and should not be handled as a comment indicator :-)