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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read in scientific notation data with GetStringBlock()

Solved!
Go to solution

Hi, I wrote a vbs dataplugin to hand a file format I have been working with. It works except it adds 10^8 to each value read in. 

 

data is in the following format in ascii file:  

0.00000000E+000, 3.64626834E+000
1.25000000E+001, 9.34699104E+000
2.50000000E+001, 9.43020247E+000

 

I have attached an example of the text file and my vbs script code. 

 

Anyone have any idea what I'm missing? Do I need to parse the data somehow first and not use the E+000 format for GetStringBlock() to read in the value properly? 

Download All
0 Kudos
Message 1 of 3
(2,361 Views)
Solution
Accepted by jdferdon

Hi,

I think you mixed up two formatting options. Please replace 

File.Formatter.ThousandSeparator = "."

with

File.Formatter.DecimalPoint = "."
0 Kudos
Message 2 of 3
(2,331 Views)

Yep, that was it, thanks for finding my silly errors. 

0 Kudos
Message 3 of 3
(2,323 Views)