LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search through a data directory and display the data that falls within the dates

Solved!
Go to solution

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

0 Kudos
Message 1 of 11
(4,218 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(4,207 Views)
Thanks for your input, I tried that example with the recursive file list but to get the data I want I use the range vi and set the upper and lower limit of my time stamp and feed the timestamp info from the file dir info to x. then take the timestamp output of the range function and bundle it with the name of the files. That didn't work. I had high hope for it. The results I get is an array of all the files with all timestamp equal to my lower limit
0 Kudos
Message 3 of 11
(4,198 Views)

Show your code, perhaps there's an error there.

 

It's perfectly legal to use IN RANGE on timestamp values.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 11
(4,191 Views)

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

0 Kudos
Message 5 of 11
(4,188 Views)

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 11
(4,181 Views)

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

0 Kudos
Message 7 of 11
(4,171 Views)

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 11
(4,156 Views)
Solution
Accepted by topic author ritch_by_nature

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

0 Kudos
Message 9 of 11
(4,150 Views)

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

0 Kudos
Message 10 of 11
(4,146 Views)