LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string to 2D string array conversion

Hi,

I have a string like this below. I would like to extract all the texts within the quotes "  ". How to do that?.

 

05-Mar.20:52   skalyana    label type "BASELINE_1.2" (locked)
28-Apr.19:19   skalyana    label type "BASELINE_1.8"

 

i have tried using Match regular expression. I am able to extract one text within " ".

 

I would like to know how to extract all the text within " "

I have attached the vi for your reference

Thanks

Kalyan

 

0 Kudos
Message 1 of 23
(3,585 Views)

Use a While Loop with a Shift Register to keep looking until you've found them all.

 

string to 2D string array conversion.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 23
(3,567 Views)

Hi,

    Thanks for the solution. One more clarification. I would like to remove the character " from the output.

Example like this

BASELINE_1.2

BASELINE_1.8

How to do that?

Thanks

Kalyan

0 Kudos
Message 3 of 23
(3,560 Views)

With a submatch, notice the parentheses and the new output (Match Pattern is expandable).

 

string to 2D string array conversion.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 4 of 23
(3,559 Views)

Hi,

   I would like to extract the text between the character ( ) also.

 for example here locked (locked)

Thanks

Kalyan

 

0 Kudos
Message 5 of 23
(3,548 Views)

I don't see parentheses in your sample data.  Do you want what's in quotes AND parentheses or are you confused about the parentheses I've added?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 23
(3,543 Views)

Hi,

 

05-Mar.20:52   skalyana    label type "BASELINE_1.2" (locked)
28-Apr.19:19   skalyana    label type "BASELINE_1.8"

 

I need both the text within " " and within ( ) from the above sample.

 

Thanks

Kalyan

 

0 Kudos
Message 7 of 23
(3,534 Views)

Sorry, I missed seeing (locked) in your original data.  This doesn't return them in order.  Is that important?

 

string to 2D string array conversion_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 8 of 23
(3,525 Views)

Hi Jim,

 

its simply superb...Smiley Happy

 

how to get more info on these 'Regular Expressions', is there any KB (knowledge base) or tutorial available for the same.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 9 of 23
(3,520 Views)

@moderator1983 wrote:

how to get more info on these 'Regular Expressions', is there any KB (knowledge base) or tutorial available for the same.


Click on the "regex" link in my signature; it's my favorite.  Darin.K contributed this cool tool to the Community; it's worth downloading and playing with.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 10 of 23
(3,517 Views)