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: 

Reading text files with mixed data types.

Solved!
Go to solution

I have been able to read an ASCII text file having mixed types of numbers (integer, real) and strings.  I cannot, however, read a time stamp that's in calendar and clock for mat (dd/mm/yy hh:mm:ss).  Given the line

 

12 34 03/26/11 01:23:45 56 78 90

 

I'd like to read the time directly, but so far all I can do is read the date/time as strings.  If reading it as a string is the best I can do, how I convert it to an internal time value?

0 Kudos
Message 1 of 6
(2,553 Views)

Use the Scan from String function.  Use a format code that corresponds to the time format of your text.

0 Kudos
Message 2 of 6
(2,550 Views)

if you post your file in here we could give you an example on how to do that.

Based on the information already given, this is what I have come up with 😉

 

Apologies if it doesn't really match with what you're looking for, but it's the best I could do with your info

 

ConvertTime.png

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
Message 3 of 6
(2,538 Views)
Solution
Accepted by topic author RT56

No need to break apart the time/date string into two different things.  Do it in one shot.

 

 

Message 4 of 6
(2,532 Views)

 


@Ravens Fan wrote:

No need to break apart the time/date string into two different things.  Do it in one shot.


That should work, but for some "strange" reason, it never does with me.  Must be something about me I guess 😉

 

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 5 of 6
(2,528 Views)

Bjorn and Mike,

 

Thanks again for the help and ideas.  Attached is my solution, which, so far, seems to work.  Unfortunately, this should have been the easy part of the program.

 

Best regards,

 

Robin

0 Kudos
Message 6 of 6
(2,505 Views)