LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search for file based on file date

I have an application that performs testing and I calculate and record several metrics into datalog files.  For certain metrics, I create a new datalog file for each day of testing.

 

What I want to be able to do for one metric in particular is to recall historic data from previous files programatically. In other words, I want to display the previous day's data or week old data as a comparison to the current day's data without any user intervention.

 

My file naming convention is to use an identifier for the type of data stored and then include the date the file was created (one file per day) ie.  FPY_09-19-12.dl  (FPY = First Pass Yield btw)

 

I could probably take the current day's file path\name and go through some routine to change the date info but this seems kludgy and would have to account for weekends, holidays and what not.

 

My prefrence would be to automatically search the data file path or folder (all files for a given metric are stored in a single network folder) and find the most recent file that is older than the current date or perhaps a weeks worth of files so I can average data across multiple days.

 

Any thoughts on an approach to this would be appreciated.

Doug

"My only wish is that I am capable of learning each and every day until my last breath."
0 Kudos
Message 1 of 2
(2,355 Views)

The List Folder function will return to you a list of files as an array of strings. You could then search this string. If you want to deal with timestamps (perhaps some of your searching may be easier if you have a timestamp datatype), then you can simply convert each string in the array. Something like this:

 

0 Kudos
Message 2 of 2
(2,343 Views)