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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read spreadsheet with different data formats

Solved!
Go to solution

Hello Application engineers,

 

I would like to do a small program to process stock historical data. The data can be downloaded from yahoo finance page, for example, Microsoft stock (MSFT), see the attached data.  It has date format for the first column and prices and volume in floating format for all rest columns. 

edmonton_1-1637446320775.png

 

I want to use two read delimited spreadsheet VIs to read the data, one uses date format to read date and another uses floating format to read all prices and volume  data. Then I can manipulate the data in any way for subsequent data processing. However, the read VI does not work as I thought. The floating format just read the year, ignoring all other data. The date format just got zero for the first column. 

 

Could someone help me with the reading issue?

 

Thanks.

 

edmonton_2-1637447092528.pngedmonton_3-1637447208843.png

 

Download All
0 Kudos
Message 1 of 3
(762 Views)
Solution
Accepted by topic author edmonton

Hi edmonton,

 

ReadFromSpreadsheetFile uses SpreadsheetStringToArray internally, and that functions doesn't seem to like those timestamp format specifiers…

Maybe you should compare your format string with the data formatting in your CSV file…

 

See this:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(710 Views)

Thanks

0 Kudos
Message 3 of 3
(695 Views)