LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sorting out a text file into an array

I am downloading information from non-National instruments hardware.

I am receiving something similar to the following:

\s5/19/01\s\s12:00a\s\s\s76.0\s\s\s75.9

This information is getting sorted into arrays for further manipulation later.

The trouble comes into play when I try to separate the date, time etc.

right now I am using "match pattern" to truncate after \s\s.


I am trying to extract the following configuration.

[date] [time] [temp] without changing the number of available spaces in the final array.


is there a way i can ask a VI to allocate 8 spaces for the 1st cell of the array and 7,5,etc. spaces, there after?
0 Kudos
Message 1 of 2
(2,604 Views)
The Match Pattern VI is great if you do not have a consistant string length. However, it appears you might have consistant string-lengths, and if so, you could consider using the String Subset VI, where your 2 main considerations are offset and length. So, if your date-field is always of length 7 with an offset of 2, then you'll always get the 7 characters beginning at position 2 of the initial string. Just one method of many - good luck.
0 Kudos
Message 2 of 2
(2,604 Views)