LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

csv file timestamp question

Hello

I have a csv file (attached) that has in the first column a time stamp in the format 11:35 (hh:mm)....so far so good.

 

I am reading the value from the file using the ReadCellFromExcell.vi (last row value only), but the value returned looks like 0.4826388888

 

After doing some searching on the forum and under LV help I'm no closer to understanding what is happening here, and would appreciate some clarification

 

There seems to be nothing out of the ordinary with my coding, as other cells are reading fine.

 

Could somebody enlighten me?

 

Thanks and regards

Ray

0 Kudos
Message 1 of 5
(4,230 Views)

We would help if we knew what this ReadCellFromExcell VI is. Is this something you wrote? Is it something you got from the forum? If so please indicate where you got it. Better yet, upload your code so we can see what you're doing. In all likelyhood the VI is simply trying to convert the value into a number assuming a numerical format rather than some time format.

0 Kudos
Message 2 of 5
(4,225 Views)

Vi attached....actually I picked it up off this forum

0 Kudos
Message 3 of 5
(4,221 Views)

If you are using Excel to open a csv file, you are doing a lot of unnecessary work, it seems to me. Its a text file and all you need is Read From Speadsheet File.

 

Not sure exactly why the Excel rad does not work but Excel does store timestamps as hh:mm:ss string. It stores them as numer of seonds sine a date I can't remember offhand so if you  used  a timstamp format as  the data type to read, the interpetation will probably fail.

0 Kudos
Message 4 of 5
(4,220 Views)

Using Read From Spreadsheet File would be far easier since you don't have to use ActiveX. If you select the string instance of that polymorphic VI you will get your data as a 2D array of strings which will allow you to easily parse the first column as a time. Something along these lines:

 

0 Kudos
Message 5 of 5
(4,204 Views)