Jump to content
Krillin

File sort by date

Recommended Posts

Krillin

Hi,

I search since sometimes solution of my problem. I must read one ini file where it will tell me false=1 or false=0. Until now it's fine, but my script must get the most recent ini file in the same folder from the date where are actually.

Example : monday.ini, tuesday.ini,...

Do you have any solution for my case? thank you!

Share this post


Link to post
Share on other sites
mikell

The most evident and easy solution is to name these files  "20160802.ini"  and so

Share this post


Link to post
Share on other sites
ViciousXUSMC

So is it just 7 .ini files that overwrite each week or do the file names also contain the year and month?

Will the file you want always be the most recently modified one?

Share this post


Link to post
Share on other sites
JLogan3o13

@Krillin how about the other part of ViciousXUSMC's question, are the filenames simple Monday, Tuesday, Wednesday, etc.? Or do they have dates in them as well? We need more information in order to assist.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
Krillin

Yes, each of them has the name, but they wont show the date. But finally i found it, using @wday.

Share this post


Link to post
Share on other sites
ViciousXUSMC

FileListToArray() --> FileGetTime() --> ArraySort()

 

I have something I wrote that uses this concept to always find the most recently modified file.  

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×