(imported comment written by jnovak91)
Help please! I am struggling with building this analysis. I have read through the Tuples section in the Relevance Language Guide as well as Jesse’s response but I am just not getting the concept of how to apply it to what I need. I am pretty sure I can get away with just searching through all of the files in that folder for my text string (which should simplify it) but if I could filter on just the html files, that would make it more efficient (I think). I have the following parts:
Return the date of the most recent log file in format I want (this gets the newest file regardless of the extension; I want just the date of the newest .html extension):
Q: ((year of it as string & month of it as two digits & day_of_month of it as two digits) of date(local time zone) of it & " "& (two digit hour of it as string & “:” & two digit minute of it as string & “:” & two digit second of it as string) of time (local time zone) of it) of creation time of file whose (creation time of it = (maximum of creation times of files of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder)) of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder
A: 20100304 12:54:59
I then tried filtering out just the .html file with this:
Q: ((year of it as string & month of it as two digits & day_of_month of it as two digits) of date(local time zone) of it & " "& (two digit hour of it as string & “:” & two digit minute of it as string & “:” & two digit second of it as string) of time (local time zone) of it) of creation time of it whose (creation time of it = (maximum of creation times of files of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder)) of files whose (name of it ends with “.html”) of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder
A: 20100304 12:54:59
Which I thought worked until I created a file in that folder that was newer than the .html file with a different extension.
Q: ((year of it as string & month of it as two digits & day_of_month of it as two digits) of date(local time zone) of it & " "& (two digit hour of it as string & “:” & two digit minute of it as string & “:” & two digit second of it as string) of time (local time zone) of it) of creation time of it whose (creation time of it = (maximum of creation times of files of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder)) of files whose (name of it ends with “.html”) of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder
E: Singular expression refers to nonexistent object.
After trying to get the above to work, I took a break from that stuff and started working on my search strings and seeing if I could find what I was looking for. I got this to work:
Q: exists lines whose (it contains “Chkdsk: Successful on C”) of files of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder
A: True
And then I tried expanding on it with this to search just the .html files. Which I think works because it evaluates faster than the above:
Q: exists lines whose (it contains “Chkdsk: Successful on C”) of files whose (name of it ends with “.html”) of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder
A: True
Q: exists lines whose (it contains “ChkdskZZZZZZZ: Successful on C”) of files whose (name of it ends with “.html”) of folder “XXXXXX” of folder “XXXXXX” of parent folder of windows folder
A: False
I then tried incorporating the pieces as “items” in a tuple based off of Jesse’s post and it just got ugly from there.
Am I overcomplicating it? All I am looking to get is the creation date of the most recent .html file in “yyyymmdd time” format that has the words “Chkdsk: Successful on C” in it. The search string will be in other .html files in that folder but I just want the date of the most recent on. Once I get it working I’ll need to expand it to about ten unique search strings.
Any direction/help is greatly appreciated.
Thank you,
Jason