LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search and extract a row from a 2D array

Hi, I have the array:

thor: ipc info 00:38:26.109 MHR 71.12, Quality 0.44, Valid 0
thor: ipc info 00:38:26.127 FHR 134.83, Quality 0.00, Valid 0
thor: ipc info 00:38:27.119 MHR 70.90, Quality 0.33, Valid 0
thor: ipc info 00:38:30.117 MHR 70.66, Quality 0.06, Valid 0
thor: ipc info 00:38:30.121 FHR 134.83, Quality 0.00, Valid 0
thor: ipc info 00:38:31.113 MHR 70.24, Quality 0.08, Valid 0
thor: ipc info 00:38:31.121 FHR 134.83, Quality 0.00, Valid 0
thor: ipc info 00:38:32.107 MHR 70.16, Quality 0.09, Valid 0
thor: ipc info 00:38:32.123 FHR 134.83, Quality 0.00, Valid 0
thor: ipc info 00:38:33.125 MHR 70.16, Quality 0.29, Valid 0
thor: ipc info 00:38:33.129 FHR 134.83, Quality 0.00, Valid 0
thor: ipc info 00:38:34.121 MHR 70.10, Quality 0.19, Valid 0
thor: ipc info 00:38:34.136 FHR 134.83, Quality 0.00, Valid 0
thor: ipc info 00:38:35.113 MHR 70.06, Quality 0.31, Valid 0
thor: ipc info 00:38:35.120 FHR 134.83, Quality 0.00, Valid 0
thor: ipc info 00:38:35.372 Tap detected! 1 taps!
thor: ipc info 00:38:33.125 MHR 70.16, Quality 0.29, Valid 0
thor: ipc info 00:38:33.129 FHR 134.83, Quality 0.00, Valid 0

 

The line: thor "ipc info 00:38:35.372 Tap detected! 1 taps!" could be at any row in this array. How do I search the rows to extract this string wherever it may be?

0 Kudos
Message 1 of 4
(1,921 Views)
0 Kudos
Message 2 of 4
(1,914 Views)

Use a FOR loop to index over the array.  Use whatever checking algorithm you deem necessary to check each line.  When you find the line, stop the loop (enable the Conditional Terminal) and output the value from the i terminal.  You should also output the result of the last check so you know if the loop actually found something or it just ran out of elements.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(1,892 Views)

Does that array element exist exactly once and you want to find the index?

Are all matching elements verbatim identical or are there variable parts that should be ignored?

I am not familiar with the term "extract". Do you want to delete all matching array elements, making the array smaller? For that, a for loop with a conditional output tunnel would do the job.

If there is never more than one occurrence, search&delete from array would work.

 

Please define the problem better!

0 Kudos
Message 4 of 4
(1,883 Views)