LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scan tolken string

Solved!
Go to solution

Wow thanks.

 

My frustration all this time has been wiring the wrong output.  

 

Need to follow my own rules

 

1. Don't work turn it on

2. Still don't work plug it in

Dan Shangraw, P.E.


   

0 Kudos
Message 11 of 15
(2,126 Views)

Good rules!

 

Scan String for Tokens is a very powerful tool for parsing complicated strings.  Along with the power comes a significant level of complexity and a steep learning curve.  I have found it to be very helpful to create a number of small test VIs while learning how to use it.  The Delimiters array and the Operators array work in subtly different ways.

 

For your string the Match Pattern and String to Spreadsheet Array functions are probably adequate as has been suggested by others.

 

I have used the Scan String for Tokens for parsing assembly language as part of a cross assembler.

 

Lynn 

0 Kudos
Message 12 of 15
(2,117 Views)

I use the scan for tokens all over the place.

 

Performance is pretty good even with large strings because it doesn't split up the original string, allowing you to search in the original data and only allocate new memory for the found strings.  Reading in a big file and need to find a few small parts? Scan for tokens is your man

 

If your search is repetitive you can also cache the delimiters although there was a bug in this a while back (I filed it but I can't find it any more.  I think the bug was in 6.1 so it's most likely long gone by now).

 

Shane.

Message Edited by Intaris on 08-12-2009 08:35 AM
0 Kudos
Message 13 of 15
(2,113 Views)

Escrito por Alain S:

Just in case you expect more than 1 string between tokens 🙂

 

SNAG-019.jpg  

 

SNAG-020.jpg 

 

 

No one asked for it, yet, but who knows what tomorrow brings Smiley Very Happy


Just that I need, Thanks!

0 Kudos
Message 14 of 15
(2,065 Views)

Two instances per loop!?  kaboom, mind blown!  I too have struggled with this primitive for YEARS thinking it must have an obvious use case that was eluding me.  You have inspired the attached vi (back-saved to 8.0) that pulls out desired XML attributes out of a string.

Message 15 of 15
(1,371 Views)