LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Utility VI for searching for the occurance of a string in all files in a directory

Is anyone aware of a utility VI that can search for a string(s) in all
file types such as doc, xls, ppt etc in a specified directory?
0 Kudos
Message 1 of 3
(2,391 Views)
It should be very simple to build it. The first step is to list all the files in a directory, then for each file, read the file (use the Read Characters From File.vi, depends the file size, you might want to break up the read operation), then use the "Match Pattern" vi from the string pallette to find what you need. Following is a simple psuedo code.

Get a list of all files in a directory
For each file
read the file in as binary string or character
search the string using "Match Pattern" or "Search N Replace"
do whatever you need with the result
Next file

Joe
0 Kudos
Message 2 of 3
(2,391 Views)

Greetings,

 

I'm having an issue (using 8.5) with a directory read in. I've attached my elementary VI. Basically I want to read in mutliple files (they will be the same array size), and analyze each file. I am confident I will be able to analyze the data as necessary, I'm just having a problem parsing the data. Verbally I know exactly what I need to do just doesn't seem to be working in labview. Reading in the directory isn't the hard part, but breaking up the 2D data into the number of files I have apparently is for me. 

 

1. Read in (user defined) directory

2. List the file names | # of files in the directory

3. Perform MAX value and % analysis of data on AMP array 

 

Any help would be greatly appreciated. Even if it's just verbally pointing me in the right direction. I've attached the VI and 3 example data files I read in.

 

Thanks in advance...I really feel like I should know this one, but I usually deal in individual files, this is my first directory read.

 

Best Regards,

 

Chazzzmd 

0 Kudos
Message 3 of 3
(2,079 Views)