LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Text string to 2d array

Solved!
Go to solution

May i know how can i convert the data string into array?

I need to convert the string data to array.

For example, for the data shown:

 

I want to remove the first 2 headers:

Then only kept the only the 4th,5th and 6th columns of each row.

 #123 remove

#324 remove

1 2 3 4 5 6

1 2 3 7 8 9

1 2 3 4 5 6

3 2 1 6 4 2

...

 

To become:

 

 4 5 6
 7 8 9
 4 5 6
 6 4 2

 

and saved them into 2d array of 4x3

0 Kudos
Message 1 of 3
(3,376 Views)

Dear all,

 

Can it still run fast if it has around 15 k rows of data to sort and change to array?

 

Thank you!

0 Kudos
Message 2 of 3
(3,374 Views)
Solution
Accepted by topic author Joven

Open the file, read the first 2 lines using the Read From Text File (right-click on it to enable reading lines and set the count to 2), then read the rest of the file, use Spreadsheet String To Array to convert to a 2D array, and finally use Array Subset or Delete From Array to reduce to just the columns you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 3
(3,352 Views)