LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extract data from from array string

Hello,

 

I would like some help to extract the lines of code after the "CALL ZocSend" command and place the extracted data into another array file.

 

INPUT ARRAY:

CALL ZocTimeout 60
CALL ZocWaitForSeq 100000000
CALL ZocDelay 0.1

CALL ZocWaitForSeq 100000000
CALL ZocSend "prog:gpio:w:dsp_rf_reset:00^M"
CALL ZocDelay 0.1

CALL ZocTimeout 60
CALL ZocWaitForSeq 100000000
CALL ZocDelay 0.1

CALL ZocSend "PROG:I2C:CODECA:WRITE:0000^M"
CALL ZocWaitForSeq 100000000
CALL ZocDelay 0.1

CALL ZocSend "poc:powerup_config^M"
CALL ZocWaitForSeq 100000000
CALL ZocDelay 0.1

 

EXTRACTED OUTPUT ARRAY:

prog:gpio:w:dsp_rf_reset:00

PROG:I2C:CODECA:WRITE:0000

poc:powerup_config

 

Any help will be greatly appreciated.

 

Thanks,

hiNi.

Download All
0 Kudos
Message 1 of 7
(4,292 Views)

I'm not clear on precisely what you're after because there are several instances of the "CALL ZocSend" command in your file.

 

This will give you all the results after the first instance:

text%20extract%20to%20array[1].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 7
(4,271 Views)

Thanks for getting me started.  In the attached updated VI, I would like to get rid of the empty cells and have the output array with just the three enteries:

 

prog:gpio:w:dsp_rf_reset:00

PROG:I2C:CODECA:WRITE:0000

poc:powerup_config

 

0 Kudos
Message 3 of 7
(4,266 Views)

Much easier than that 🙂

 

text%20extract%20to%20array[1].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 4 of 7
(4,262 Views)

2012 snippet:

Example_VI.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 5 of 7
(4,260 Views)

You can also get rid of the quotation marks using the String Subset vi.  Set the offset to 1 to remove the first one, and set the length to be the initial string length minus 2.

 

 

0 Kudos
Message 6 of 7
(4,243 Views)

@pjr1121 wrote:

You can also get rid of the quotation marks using the String Subset vi.  Set the offset to 1 to remove the first one, and set the length to be the initial string length minus 2.

 

 


Even easier than that, and for fun with Regular Expressions, change the contents of the For Loop to this:

Example_VI.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 7 of 7
(4,234 Views)