LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change string to (string and array)

Solved!
Go to solution

Hi i have a data set with the following type of data (.csv - somma separated) being read in with spreadsheet read (set to string), it gives me:

 

Waimea,21.625,-158.025,0,299

Kahuku,21.625,-157.9,0,566

Kaena Oe W,21.5,-158.275,0,130 ..... yadda, yadda

 

what i want to do is turn this 1d string into a 1d string of the names at the begining. Length varies found it easiest to find the name length is to search for the first occurance of the comma, that gives the length of the name (+1) so i know how many characters i need to crop off the start. And thats where iv'e got stuck.

 

Is there an easier way of doing this? ideally i need a 'delete from array' for a string operation, is that posible?

 

Chears.

John P.

0 Kudos
Message 1 of 21
(4,115 Views)
Solution
Accepted by topic author John Pierson
If you would specify the correct delimiter (,) with the Read From Spreadsheet File function, you would have a 2D array and you would just use the Index Array function to get column 0.
Message 2 of 21
(4,102 Views)

@Dennis Knutson

 

Wow i really was having a dumb moment, yup that solves it cheers.

0 Kudos
Message 4 of 21
(4,085 Views)

right so now i have a 2d array with the data in columns 1-4 and the names in column 0,

how do i crop off column 0 from the 2d array and then convert the remaning array into a numerical 2d array?

 

ta.

 

0 Kudos
Message 5 of 21
(4,074 Views)
you could use replace array subset.vi
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 6 of 21
(4,068 Views)

Not sure how that'll help, that one allows me to change a string portion, what i want to do is simply cut up the string, not blank portions of it.

or am i missing a cleaver way of using it?

0 Kudos
Message 7 of 21
(4,065 Views)
how would you like to cut up the string?
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 8 of 21
(4,063 Views)

and if you want to convert strings to decimal look in the strings pallette under conversions

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 9 of 21
(4,059 Views)
so you want to send the names to one array and than the numbers to another?
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 10 of 21
(4,056 Views)