LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change string to (string and array)

Solved!
Go to solution

i've got an string array that is currently like this:

 

| place name 1 | 25.3 | 34.9 | 0 | 3456 |

.....yadda, yadda

|place name x | 34.3 | 34.6 | 13 | 2332 |

 

i want to cut this 2d string array into:

 

| place name 1 | place name 2| .....................| place name x| as a string array

 

and 

 

 | 25.3 | 34.9 | 0 | 3456 |

........yadda, yadda

 | 34.3 | 34.6 | 13 | 2332 | in a dbl 2d array

0 Kudos
Message 11 of 21
(1,435 Views)
Use Array to get the other columns and wire the output to Fract/Exp String To Number.
Message 12 of 21
(1,434 Views)

@Harold Timmis

 

yeah pretty much txt to one 1.d string array the numbers into a 2d dbl array.

0 Kudos
Message 13 of 21
(1,433 Views)

@Dennis Knutson

 

Yup that gets me a dbl array of the data (jsut need to crop off the first column as its full of 0's - not a problem at all)

Any ideas about the text string extraction of column 0?

 

(attatchment shows current vi back pannel)

Message Edited by John Pierson on 09-10-2009 07:41 AM
0 Kudos
Message 14 of 21
(1,427 Views)
use an index array on the string and col = 0
Message Edited by Harold Timmis on 09-10-2009 08:50 AM
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 15 of 21
(1,415 Views)

cool, that works, although i've just spotted a complication, the data that i'm comapring it to is in alphabetical order, this isn't is there a way to alphabetize the original 2d string acording to the 0'th column for each row?

 

- i know it keeps getting more complicated!

 

Basically i need a sort 1D array, but on that will do one of alphabeical  order a-z

-ha! the sort 1d array actually accepts a string - may well have sorted the problem!

Message Edited by John Pierson on 09-10-2009 08:16 AM
Message Edited by John Pierson on 09-10-2009 08:18 AM
0 Kudos
Message 16 of 21
(1,397 Views)
use the sort 1d array.vi it will sort a string a-z
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 17 of 21
(1,392 Views)

yeah it sorts the places, but i also need the data that follows the names on each line (the whole column) to be rearanged with it.

So basically order each row in acordance with the the column 0 alphabetical order.

 

i could go back to original problem of leaving it as a 1d array of the places and data in the format: 'name,000,000,000,000 and then reaarange and the data will reagrange with it (as part of its name), but then i'm back to the original problem of how to convert the incorrectly aranged data back into a 2d array.

Message Edited by John Pierson on 09-10-2009 08:31 AM
Message Edited by John Pierson on 09-10-2009 08:32 AM
0 Kudos
Message 18 of 21
(1,388 Views)

this may help:

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 19 of 21
(1,383 Views)

well i've found a non-labview way to do it, just go into excel, data - sort - sort by column A, a-z assending

 

its not a labview solution but it'll work for what i need to do for now.

 

John P.

0 Kudos
Message 20 of 21
(1,382 Views)