LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

recall data files



hello,

   1. i am saving the files with date  and time  Eg:  1-april-2007. xls and onwards..
2. if i wanted to recall the datas in the files within the date
from: 1 -april-2007 to 16-april-2007 how can i capture the file from the file list..
3. i know how to capture the particular date file name, but between the date i have no idea..
so iam asking you good suggesion..
4. Example Vi's are prefered.


regards,
TIJU

LV 8.0

Regards

Tiju Thomas
0 Kudos
Message 1 of 7
(3,681 Views)

If I understand, you are trying to import data from various files, each named by a date and all in the same folder?

If that's it, then a simple (though I'm not sure if most effective) way to do this would be to just write a for loop that contains the import functions you are using and manipulate the iterations increment through your date range.  Of course, you would need something along the lines of a state machine to check which month and year you are in and account for things like leap year and the varying number of days in each month.  But this seems like it would be a fairly simple implementation.

I imagine there could be a way to do it with ActiveX that may be simpler, but I don't have a lot of experience with those types of applications.

David_B
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,655 Views)

 

Yes..You are right..various files, each named by a date and all in the same folder..!!

i just using for loop iteration for capturing a particular file with date and time.

pls suggest any solution for state machine to check which month and year.

Or Attach any Example  VI ..

 

regards

TIJU

LV 8.0

Regards

Tiju Thomas
0 Kudos
Message 3 of 7
(3,650 Views)
Hi Tiju,

I prefer to name files by a scheme like YYYYMMDD (e.g. today will be 20080418...). This has advantages:
- only numbers, easier to parse
- sorting by name and date will result in the same orderSmiley Wink
- may be extended by HHMMSSSmiley Wink

To check existance of those files simply create the filename and try to open this file (with "read only " mode) - when an error occurs the file doesn't exist...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,648 Views)
 

If you are looking for someone to write the code for you, we have a directory of companies that are available:  National Instruments Alliance Partner Program

David_B
Applications Engineer
National Instruments
0 Kudos
Message 5 of 7
(3,632 Views)

hi..

i already formatted the file name DDMMYYY format ..

that i cannot chage..need to order thr files int o a Array.

Any sorting of number (filenames) is possible..??

 

regards.

TIJU

Regards

Tiju Thomas
0 Kudos
Message 6 of 7
(3,614 Views)
Hi Tiju,

"1-april-2008" looks quite different than DDMMYYY to me...

Anyway:
Sorting your filenames is rather tricky (Did I say I prefer YYYYMMDD?). You can list folder contents ("List Folder") and get an array of filenames. You have to parse those filenames into their parts (DD, MM and YYYY). Now you can do the sorting (a cluster can be of great help, when the elements are in the correct order!).
Or you can trust on the file creation date ("File/Directory Info") and sort the files according to this...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(3,610 Views)