LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

auto search all the files with same extension name in a given directory

Hi, all. I got a question and hope someone can help me find out solutions. I have thousands of data files with the same extension name. They are saved in the same directory. In this directory, many files with different extension names exist. How can a program automatically search this directory and count each of the files with a certain extension name?
 
For example, the data files have extension name "dat", from 0001.dat to 1000.dat. Each data file has several numbers. They are saved in the same directory. I need to give the name of the directory to the program, then this program goes to the directory and look for each of "dat" file, count the amount of the data and calculate the average number of the data for each file, and list the file whose average is lower than a constant.
 
I really appreciate for any suggestions of solution. Thanks in advance.
0 Kudos
Message 1 of 3
(3,492 Views)

You can use the "List Folder" function, and then just wire in a pattern of *.dat

That will return the array of all the files with that extension.  From that simply use the array size VI and bingo there is the number of .dat files in that directory.

Message 2 of 3
(3,491 Views)
Thanks, Evan. I am looking into this function and wonder how it will sort the files. Hope it works. Thank you.
0 Kudos
Message 3 of 3
(3,474 Views)