LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search csv file match pattern in array

Hello,

 

I am new to Labview.  This probably simple but couldn't figure it out.

Here is my question.

I am trying to search in a csv file and look up string match pattern like "test" and display in an array.

My problem is I couldn't figure how to just display the match result only and don't want to display the empty field.

This might be confusion but please find the attached csv file and the VI.

Please help.

Thank you

marlin

Download All
0 Kudos
Message 1 of 6
(3,986 Views)

Hi Marlin,

 I am confused by your question.  You say that you want to display the match results, but how?  You already know what the results look like because it is the text you searched for.  Do you want to know how many matches there were?

Jim

LV 2020
0 Kudos
Message 2 of 6
(3,978 Views)

Hi Jim,

 

Sorry for the confusion.

And you're right, I would like to know how many test are in the file or matches.

For example in the file there are 4 tests done and I want be able to search thru file until end of file and be able to display the result that there are 4 test total.   There could be 5 test in the file or 6 or 7 etc...

I hope this make sense.

 

Thank you again Jim

marlin

0 Kudos
Message 3 of 6
(3,972 Views)

@marlin12 wrote:

don't want to display the empty field.


To get it to not have the empty fields, you can't use the auto indexing on the For Loop, but use a case statement (or Select) to only add to the array using build array when you have a match.

Search CSV Match Pattern.png

Omar
0 Kudos
Message 4 of 6
(3,951 Views)

Marlin,

 

I modified your VI, but left your code in place.

 

Jim

Jim

LV 2020
0 Kudos
Message 5 of 6
(3,950 Views)

Hi Jim,

 

Thank you so much, it's exactly what I needed.

 

marlin

0 Kudos
Message 6 of 6
(3,934 Views)