LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read date and time frm text file

Hello,

   so I am trying to read a data from a text file. In the picture you will see how the data is written in the file. My issue is I am using read from spreadsheet.vi and it will not read the date and and time data.  For example if the date and time in the file is 19 jan 2015  22:09:05 , the output of the read from spreadsheet. vi comes out as 19 in one array slot for the date and 22 in another for the time.  I use comma delimited and %s, it doesnt work at all. I tried saving the file as .csv file and still I get the same answer.

Please help.

 

 

 

 

 

P.S please post any vi solution in Labview 2012

0 Kudos
Message 1 of 5
(3,842 Views)

uh huh... that's a weird way to share your spreadsheet data with us...

You probably have a delimiter problem. Share your code and/or the actual text that you're trying to read and we can help more.

 

You're goingt to get an array like this: [9. 5, 3, 43, 69, 6493, 23, 28, Jan, 2015, 13:42:15]

If the delimiter is the same between all of those cells. You're then going to have to take the strings (each element of the array) and convert to a Timestamp using Scan From String

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 5
(3,837 Views)

P.S. -- please do not post pictures.  You are asking us to take the extra trouble to help you by posting code, and for a specific Version of LabVIEW.  Have the common courtesy to help us by posting (a) actual data files with the data intact, and (b) actual VIs of the code you are trying to get to work.  We are not your indentured servants (see 13th Amendment).  If you need to post multiple files, consider placing them in a folder and sending the folder as a Compressed (.zip) File.

 

BS

Message 3 of 5
(3,683 Views)

Snip.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 4 of 5
(3,663 Views)

Check out the When Posting Code section of this link.  It talks about snippets and how to post code which we can better help you with.

 

https://decibel.ni.com/content/docs/DOC-40451

 

Also if you post a snippet it states what version of LabVIEW it was made with, so we try to post code back in that version, knowing you should be able to open it.

0 Kudos
Message 5 of 5
(3,654 Views)