09-08-2015 12:20 PM
Hello,
I have a idrectory full of data taken overtime and I am thinking of searching through the directory and display the data files for specific dates. I haven't started coding it yet but I figure i'll pick the brain of some labview SME on here and start off in the right direction. My goal is to go through a directory full of csv data files taken over a month period or longer and select the data files to process and display based on the the date it was saved. if I pick data saved from last week, last minute or last month, it should just process that exact one or more.
Please Help me start off right
Solved! Go to Solution.
09-08-2015 12:31 PM
To be completely honest, this sounds like a perfect application for DIAdem and the DataFinder. The DataFinder crawls through the data files, creating a search database, and then you use DIAdem to perform the querries and process the file(s).
Other than that, you will probably want Recursive File List and then File/Directory Info inside of a FOR loop to get the timestamp of the file. You could build this into a cluster and then autoindex out to create an array of clusters. Then Sort 1D Array to sort the array (the timestamp will need to be in the first element of the cluster for this to work).
Once you have the sorted array, it is fairly simple to do whatever querries you want.
09-08-2015 12:53 PM
09-08-2015 12:59 PM
Show your code, perhaps there's an error there.
It's perfectly legal to use IN RANGE on timestamp values.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-08-2015 01:00 PM
Sounds like you are doing something wrong. Show us what you are doing -- attach your VI (something that we can edit and execute without having to "make it ourselves").
Bob Schor
09-08-2015 01:01 PM
Don't forget that the INRANGE & COERCE function has a COERCED output.
I don't think you need that for this, but if you accidentally used it, you would get results like this.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-08-2015 01:13 PM - edited 09-08-2015 01:14 PM
Here's the code. Well I tried to use in range because I want to be able to set limit on what data I want that falls within a data interval. See attached! please post code response in labview 2012
09-08-2015 01:20 PM - edited 09-08-2015 01:21 PM
Exactly. Why are you using the COERCED output?
You want to collect the original dates into the array, but only if it is IN RANGE.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-08-2015 01:26 PM
End Date will likely be larger than Start date, right? So End date should connect to the upper limit input. Then wire In Range? to the conditional terminal of a conditional indexing tunnel.
Lynn
09-08-2015 01:36 PM
Which is the higher number to your way of thinking, Start Date and Time or End Date and Time? Myself, I would consider End Date and Time higher. However, as you have wired it, if I specify a Start Date and Time of 1 Jan 2014 and an End Date and Time of 1 Jun 2015, no matter what the dates are on my files I will get no "hits" (that is, "In Range?" will never be true). Do you see why that is the case for your code? If not, look at your code and read the first sentence again.
Bob Schor