LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Text string to integer array - with keeping order in text string-

Solved!
Go to solution

Hello

I have a text string which contains measurement frames.

I want to place each frame in an initially 0, 11x11 array (with the same order in the text file).

 

In figure below, I tried convert to an array, but the array contains only the first "column" in the text file.

 

Any suggestions?

 

string to integer array

0 Kudos
Message 1 of 7
(2,937 Views)
Is each number really separated by a tab like you have specified?
0 Kudos
Message 2 of 7
(2,929 Views)

Please attach your code and a typical sample file.

0 Kudos
Message 3 of 7
(2,926 Views)

Hi

 

Yes, the order is the same as shown in text string.

This daya is generated by a tomographic measurement device and I want to use it in LabVIEW.

 

The .vi file and data file is attached.

 

Thanks

Download All
0 Kudos
Message 4 of 7
(2,921 Views)

Your data is separated by spaces, or multiple spaces, not tabs.

 

So using spreadsheet string to array is not going to work with the default delimiter of tab.

0 Kudos
Message 5 of 7
(2,913 Views)
Solution
Accepted by topic author Mittani HD

Ravens is right, your string is quite dirty with variable numbers of spaces, lines beginning with spaces, and space+newline delimiters.

 

In cases like this, I like "scan strings for tokens", because it can automatically contract consecutive delimiters into one. Here's a quick example.

 

 

 

Since your rows are variable lenght, a 2D array seems unsuitable, because all rows will have the same number of elements. Consider a 1D array of clusters containg 1D arrays, for example.

 

(Of course it would be cool of "spreadsheet string to array" could directly deal with consecutive delimiters as found here, so please support my idea. It certainly deserves more than 24 votes :D)

Message 6 of 7
(2,899 Views)

Thank you so much Altenbach.

My problem is solved:)

0 Kudos
Message 7 of 7
(2,881 Views)