LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parse Comma Separated String

I thought I'd post this in the LabView section, although it's G Web related, because the core functionality can be achieved with LabView.  I need to parse comma-separated strings which are numbers using G Web, and the LabView Array to Spreadsheet String and Spreadsheet String to Array components are not supported in G Web.  The following only places the first number in the array (it's an array of strings, although ultimately it needs to be an array of DBL).  Part of my problem is I'm somewhat new to LabView.  Can anyone see anything obviously wrong with this approach and what I've done?  Thank you.

 

 

0 Kudos
Message 1 of 5
(1,118 Views)

Why not use Spreadsheet String to Array, perhaps in conjunction with Scan from String if you want numeric rather than String outputs?  [You could also change the Format string in Spreadsheet String to Array if you didn't want/need the String representation, skipping the second step ...].

 

Note -- I prepared a Snippet consisting of Spreadsheet String to Array, followed by a For Loop surrounding Scan from String, and reproduced your "picture" code, but decided not to post it to give you the chance to "do it yourself" and try your own variations-on-a-theme.

 

Bob Schor

 

0 Kudos
Message 2 of 5
(1,102 Views)

Bob, thanks for your response.  Sadly, G Web doesn't support Array to Spreadsheet String and Spreadsheet String to Array, which I would have used if it was supported. 

0 Kudos
Message 3 of 5
(1,090 Views)

Sorry, I'm not familiar with "G Web".  But if you have "known" inputs, and if G Web has functions for converting "Things to Strings and Back", plus some logic for handling arrays (and writing functions, i.e. "subVI"s), it should be easy to "roll your own" Spreadsheet String/Array functions.

 

Hmm -- Google says it's an NI Product built "for your LabVIEW-based Test System".  Maybe I'll take a peek (in my copious "Free Time" ...).

 

Bob Schor

0 Kudos
Message 4 of 5
(1,061 Views)

Your google-fu is better than mine...

Frozen_0-1682016793920.png

 

---------------------------------------------
Certified LabVIEW Developer (CLD)
0 Kudos
Message 5 of 5
(1,052 Views)