LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data from string

Hello, I am trying to get some data which is contained in a string. I am pulling spurious measurements from a spectral analyzer and it comes back in a format of #<Num_digit><Num_byte><Data(1)><Data(2)....etc.  So for example I have the analzyer pulling back 20 spurious measurements and what comes back to labview is
 
 
20,4.022852E+008,-1.87E+000,4.035196E+008,-2.34E+000,4.863665E+008,-9.99E+000,3.647665E+008, etc.  This comes back in a string and what I need to do is get the data from after the 3 rd comma or <data(1)>.  I cannot for the life of me figure out how to access a portion of a string, nor can I convert it into data that I could convert.
 
does anyone have any suggestions?  The frustraing part is I know there has to be a simple solution.
 
 
Thanks,
 
 
Andrew

Message Edited by labstew on 01-12-2007 01:14 PM

0 Kudos
Message 1 of 4
(2,727 Views)
Andrew,

The Spreadsheet String to Array function with comma as delimiter should return an array with the numbers. Then just index the element you want.

Lynn
Message 2 of 4
(2,712 Views)

The string you show does not seem to match the pattern, because all values are speratated by commas, something that does not show in your template.

Anyway, you can use "Spreadsheet string to array" with a delimiter = "," (comma) and a 1D array as type. You''ll end up with an array of values. See how far you get. 🙂

0 Kudos
Message 3 of 4
(2,708 Views)
Thank you both very much,  using the Spreadsheet String to Array function worked and the data is being displayed in the right element. I had tried it earlier, but did nt convert it to 1 D array (its default is 2D I think).
 
Andrew
0 Kudos
Message 4 of 4
(2,700 Views)