SO...
i have a list of txt files now in a ListBox - its okay, but inside of these txt files the first row is a date for example 12.10.2017.
How can I check all of the files if I want to check that the date has expired. For example:
1.txt -> first row inside of text file is: 10.10.2017
2.txt -> first row inside of text file is: 19.10.2017
the result is: We would like to inform you, that the 1.txt is expired! Please check it.
Thank You again!
Dudus
FileList and Date check
Moderator: Neosoft Support
Re: FileList and Date check
Dudus:
Take a look at this code ...
... make adjustments as necessary.
Take a look at this code ...
Code: Select all
... get count of items in ListBox
ListBoxSize "ListBox3" "[LoopCount]"
... loop through each item
Loop "1" "[LoopCount]" "[LoopPosition]"
... get item
ListBoxGetItem "ListBox3" "[LoopPosition]" "[thisListItem]"
... if file exists, read first line
... NOTE: You may have to prefix file name with file path
FileExists "[thisListItem]" "[FileExistsResult]"
If "[FileExistsResult]" "=" "True"
FileRead "[thisListItem]" "1" "[thisLine1]"
... convert file date
... NOTE: Choose different file format if not default
DateToNum "[thisLine1]" "Default" "[thisFileDate]"
DateToNum "[DateShort]" "Default" "[DateToday]"
If "[DateToday] ">" "[thisFiledate]"
AlertBox "Attention" "File [thisLisItem] expired on [thisLine1]"
Endif
Else
AlertBox "Attention" "File [thisListItem] does not exist"
Endif
EndLoop
Re: FileList and Date check
Thank you Gave!
Works great! yesss
Works great! yesss