RRuelas Posted May 27, 2013 Share Posted May 27, 2013 Hello, thank you for your time and help. How can I do the following process: in a specific foler (let´s say folder name is Data) I have a lot of .mdb files, and more are created every day. I need to read the latest one, so, I´m thinking of copying it to always the same file name using the line comand copy "file".mdb myfile.mdb /y (/y switch is to overwrite without prompting). "file" is the last file created on the Data folder. How do I know which file is the latest one every time? More info: I have, for example, 1515_May27 file as the latest file, in 2 hours (or any other time), I will have 2020_May27 file, tomorrow, I will have 1515_May28 4040_May28 so, today, I need to: copy 1515_May27.mdb myfile.mdb /y in 2hours, I need to copy 2020_May27.mdb myfile.mdb /y tomorrow copy 1515_May28.mdb myfile.mdb /y and later copy 4040_May28.mdb myfile.mdb /y that is, I will be reading myfile.mdb all the time, but that will be created by copying from a different source every time, the source will be the latest file created on the Data folder. How do I know which is the latest file on the folder? need help with the script pls. Thx a lot!! Link to comment Share on other sites More sharing options...
JohnOne Posted May 27, 2013 Share Posted May 27, 2013 FileGetTime() AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
RRuelas Posted May 27, 2013 Author Share Posted May 27, 2013 Thx JohnOne for the answer, but, could you pls be more specific? I was reading about the instruction and trying it out, but don´t get what I need. Is it possible to provide a sample script on how to use the instrucion FileGetTime() and from there, get the file name? thx again, Link to comment Share on other sites More sharing options...
michaelslamet Posted May 28, 2013 Share Posted May 28, 2013 Hi, You can doing this way: #include <FileOperations.au3> by AZJIO ( Use _FO_FileSearch to read the folder content and put in into array Using For ... Next, read the file date using FileGetTime() and compare it with today's date using _DateDiff Hope you get the idea Link to comment Share on other sites More sharing options...
RRuelas Posted May 29, 2013 Author Share Posted May 29, 2013 makes sense, I will try that. Thx a lot. I will post the results. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now