APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Import csv file int-float problem? post and replies

Return to the Import csv file int-float problem? thread
Login to post to this thread

Import csv file int-float problem?
Dima ..
4 Posts

When importing a .csv file from the Data tool->new tab -> import data, the following occurs:

if .csv file contains all floats but one number/row has integers due to how file was exported by another program, import fails silently, no error message etc. at least error message would be nice, but perhaps float should be assumed if other values are float? or ask user?


this data fails:
distance,field
0.2,4051.641492
0.4,822.7388777
0.6,323.7815696
0.8,167.0679062
1,100
1.2,65.74808896

this data works
distance,field
0.2,4051.641492
0.4,822.7388777
0.6,323.7815696
0.8,167.0679062
1.0,100.0
1.2,65.74808896


Replies to Import csv file int-float problem?

Re: Import csv file int-float problem? -
Douglas Brown Avatar
Douglas Brown
449 Posts

Thanks for identifying this bug.  I was able to reproduce it and it will be fixed in the next release version 6.0.9 which will come out very soon. Doug


> When importing a .csv file from the Data tool->new
> tab -> import data, the following occurs:
>
> if .csv
> file contains all floats but one number/row has integers
> due to how file was exported by another program, import
> fails silently, no error message etc. at least error
> message would be nice, but perhaps float should be
> assumed if other values are float? or ask user?
>
>
> this data fails:
> distance,field
> 0.2,4051.641492
> 0.4,822.7388777
> 0.6,323.7815696
> 0.8,167.0679062
> 1,100
> 1.2,65.74808896
>
> this
> data works
> distance,field
> 0.2,4051.641492
> 0.4,822.738877
>
> 0.6,323.7815696
> 0.8,167.0679062
> 1.0,100.0
> 1.2,65.74808896



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book