From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-20-2011 03:11 AM - edited 06-20-2011 03:20 AM
Hello,
I would just like some help with my code. I'm trying to read data from "WAV00000.CSV", but I have a problem with the precision of numbers.
Example:
-9.980000E-3 was read as -9,000
How can I solve this problem?
Regards
Solved! Go to Solution.
06-20-2011 03:16 AM - edited 06-20-2011 03:23 AM
sljuka wrote:How can I do that?
Do what? You are not saying what the problem is, but your code seems to work just fine.
(Of course it cannot read the header and thus substitutes zeroes, but you could read the first line seperately, then set the offset accordingly before reading the spreadsheet data. You could also simply delete the first row.)
06-20-2011 03:29 AM - edited 06-20-2011 03:41 AM
Ah, OK you edited your question.
Could it be you are using a OS version where the decimal point is a comma? This is basically incompatible with CSV, because you cannot have a comma as decimal seperator and column delimiter at the same time. Your OS does not recognize the period as decimal seperator, and thus truncates the data.
Try a format of "%.;%3e" (percent-period-semicolon-percent-three-e). I cannot test, but it's worth a shot. The "%.;" should force treating the period as decimal point. Check the help.
06-21-2011 06:35 AM
Hi,
You should read the rows as string then you can convert Engineering style values to double format number by "Fract/Exp String To Number" function.
I attached the example.
Regards,
Peter
06-21-2011 09:36 AM
You probably have a Labview 2010 and I can not open your example. I have Labview 2009. Can you save this example for my version of Labview?
Regards,
06-21-2011 10:13 AM
The example posted above is pointless, because your problem has to do with the localized decimal point. (Your program works just fine in the USA).
Have you tried my suggestion with the format modification? Did it work?
06-21-2011 10:13 AM
in 2009
06-22-2011 01:55 AM
I tried but it didn't work (I don't know why). This last example is OK.
Thanks!