LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to scan MULTIPLE data files, logging key info into a spreadsheet

I have MANY burn-in data logfiles--these being text files within sub-folders within main folder(s)--all on a server.  I need to scan EACH file for certain data, and based on result, if burn-in passed, log that to excel spreadsheet, and if it failed, log failure & fail specific data to spreadsheet. 

Any ideas on how to best do this?  A primary concern.....I need to kick off the program only ONCE and have it search through ALL files within a folder and/or sub-folder?  Even if it takes the program 30 minutes to run, that's fine.  I just don't want to have to manually initiate the program to run it against every file.  It would take me a month.

Thanks for any help....
Gary
0 Kudos
Message 1 of 3
(2,651 Views)
Gary,

If your primary concern is how to locate and open the files, look at the recent thread "How do I determine if a file exists..." It talks about locating files in a directory. Once you have the list of files as an array, pass it to a for loop to search for the specific data in the file.

Lynn
0 Kudos
Message 2 of 3
(2,639 Views)
I would suggest you start with the function List Directory Recursive that you can get from OpenG. Download and install the OpenG Commander to get the entire package. The function will return an array of paths to files in your folders and sub-folders. You can even specify a pattern so that it will return a list of only *.txt files. Once you have the list, you can open each file in a loop and do your searching with the the file I/O and string functions. One thing to keep in mind for the future is that instead of separate text files, a database can handle this type of task much more effectively. You've got a couple of queries that could be performed in seconds (or minutes at the outside) but with text files, you'll have to open each one, read the data, and then search through the file for the information. If by MANY files, you mean tens of thousands, then 30 minutes might be optimistic.
Message 3 of 3
(2,637 Views)