LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Haw can I check The equality of strings?

I have a text file. It consists of a number of strings. A single word in each string.
There are also 2 "keywords" in different strings (begin and end).
In my VI I read the file. I need to insert string I have read into a 1D array of strings. But only the stirng allocated between appointed keywords (not the whole file).

The first my trouble is: can I compare string and a keyword using "="(equal) operator?

And a second one: please offer an optimal VI for this case.
Thank you.
0 Kudos
Message 1 of 7
(3,403 Views)
You text file is one single long string. You must define separators (e.g. tabs, spaces, etc) to define word boundaries.

The attached VI shows one way to do this (LabVIEW 7.0). It first extracts the substring between "begin " and " end" and then creates an array of words. In the simplest case, all separators are the same (e.g. a single space character). In this case you can use "spreadsheet string to array" to get the words directly into a 1D array of strings (case 1).

If you have a variety of separators, you can e.g. use "scan strings for tokens" in a loop as shown (case 2).

Modify as needed.
Message 2 of 7
(3,370 Views)
I am sorry for bothering you/ But I use LabView 6.1
So ther is no opportunity to study your example.
Could you conver it to 6.1 format?
0 Kudos
Message 3 of 7
(3,365 Views)
Here you go.

___________________
Try to take over the world!
Message 4 of 7
(3,361 Views)
My LabView does not want to open it too.
I am so sorry. But my true version is 6.0.1 not 6.1 as I thought. Help me please again.
0 Kudos
Message 5 of 7
(3,357 Views)
Message 6 of 7
(3,351 Views)
Thank you
0 Kudos
Message 7 of 7
(3,340 Views)