LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pick out words from a string with tabs?

Hello!

Now we have the following problem: We have an array of strings. In each string there is five words. These are separated with tabs. We now want to get these words separeted in another array. Any tip? Best regards!
0 Kudos
Message 1 of 11
(3,552 Views)
Hello Ex-jobb,

have you tried "Spreadsheet String to Array"? It can be found in the string palette.

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(3,547 Views)
Hi Ex-jobb

There are several ways to do this, see attached VI for a couple of options.

Good luck
Neil
0 Kudos
Message 3 of 11
(3,546 Views)
Hello!

Thank you for your answer. We tried something like that but it did not work. So now we know what we did wrong 🙂 Now there is one more thing. That is between two of the columns there are no tab, but we want to pick these words out too... can one do this? Because this words "disappear" because there is no tab there is just space. Numbers of space here between can be different too... best regards.
0 Kudos
Message 4 of 11
(3,541 Views)
Hi Ex-jobb

In Method 1 in the example I attached I use Scan String For Tokens.vi which allows for several delimiters to be detected including spaces and tabs. If you look at the Context Help it will explain. If you delete Method 2 from the example, and change one of the tabs (\t) in "Array" to a space (\s) or even multiple spaces you will find it will work just as well. 🙂

Hope that helps.
Neil
0 Kudos
Message 5 of 11
(3,539 Views)
Hello!

Thank you 🙂 We will try that 🙂
0 Kudos
Message 6 of 11
(3,535 Views)
Hello again 🙂

We wonder if there is any other way to do this? We would like to avoid the build array-VI...? We mean the problem that it is space between instead of tab... best regards.
0 Kudos
Message 7 of 11
(3,525 Views)
Hello GerdW!

Yes we have looked at "spreadsheet ..." but it did not fit for our wishes... but thank you for your answer.
Best regards.
0 Kudos
Message 8 of 11
(3,522 Views)
Hello Ex-jobb,

what do you want to change? There is no "Build Array" in the example...
And you can always change from tab to space as seperator like NeilR wrote and explained.

?-)

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 11
(3,511 Views)
Hello!

In the example above "string to array" in method 2 there is a build array. We would like to avoid the build array VI if it is possible.
Best regards.
0 Kudos
Message 10 of 11
(3,507 Views)