Q: ((parenthesized parts 1 of it, parenthesized parts 2 of it, parenthesized parts 5 of it) of matches (regex "^(.*)\t(.*)\t(.*)\t(.*)\t(.*)") of (it as string) of (lines whose (it contains "Run time") of file (value of variable "allusersprofile" of environment & "\Application Data\McAfee\DesktopProtection\OnDemandScanLog.txt"))as string)
A: 6/11/2011, 1:00:33 AM, Run time : 0:00:29
A: 7/2/2011, 2:27:17 AM, Run time : 2:27:04
A: 7/9/2011, 3:00:33 AM, Run time : 0:00:32
A: 7/16/2011, 2:00:51 AM, Run time : 1:00:41
A: 7/23/2011, 3:06:33 AM, Run time : 2:06:17
A: 7/30/2011, 2:00:44 AM, Run time : 1:00:35
I want to put a day in the list
A: MON, 6/11/2012, 1:00:33 AM, Run time : 0:00:29
A: MON, 7/2/2012, 2:27:17 AM, Run time : 2:27:04
A: TUE, 7/10/2012, 3:00:33 AM, Run time : 0:00:32
A: MON, 7/16/2012, 2:00:51 AM, Run time : 1:00:41
A: WED, 7/25/2012, 3:06:33 AM, Run time : 2:06:17
A: SUN, 7/29/2012, 2:00:44 AM, Run time : 1:00:35
The way I would approach it is to set it as a date object:
q: date “12 Nov 2012”
A: Mon, 12 Nov 2012
But first you would have to get the format mm/dd/yyyy into “day 3_digit_mo 4_digit_year”
There are probably more efficient ways but this works. You’ll just have to convert the "parenthesized part 1 of it:
((preceding text of first “/” of it & " " & preceding text of first “/” of following text of first “/” of it as integer as month as three letters & " " & following text of last “/” of it) of “12/12/2012”) as date
Take it one step further if you want it in the same format with:
(day_of_week of (it as date) as three letters, it) of ((preceding text of first “/” of it & " " & preceding text of first “/” of following text of first “/” of it as integer as month as three letters & " " & following text of last “/” of it) of “12/12/2012”)
another question now… many of the systems have a huge amount of data… how do I treat
( Sat, 11 Jun 2011 )
or
6/11/2011
as a date so I can filter lines less then 90 days old
Q: (
if exists file (value of variable
"allusersprofile" of environment &
"\Application Data\McAfee\DesktopProtection\OnDemandScanLog.txt") then (((((preceding text of first
"/" of following text of first
"/" of it & preceding text of first
"/" of it as integer as month as three letters &
" " & following text of last
"/" of it) of it) as date) of parenthesized parts 1 of it, parenthesized parts 1 of it, parenthesized parts 2 of it, parenthesized parts 5 of it) of matches (regex
"^(.*)\t(.*)\t(.*)\t(.*)\t(.*)") of (it as string) of (lines whose (it contains
"Run time") of file (value of variable
"allusersprofile" of environment &
"\Application Data\McAfee\DesktopProtection\OnDemandScanLog.txt"))as string)
else
"<File Not Exists>") A: ( Sat, 11 Jun 2011 ), 6/11/2011, 2:00:33 AM, Run time : 0:00:29 A: ( Sat, 02 Jul 2011 ), 7/2/2011, 4:27:17 AM, Run time : 2:27:04 A: ( Sat, 09 Jul 2011 ), 7/9/2011, 2:00:33 AM, Run time : 0:00:32 A: ( Sat, 16 Jul 2011 ), 7/16/2011, 3:00:51 AM, Run time : 1:00:41
q: (preceding text of first “Scan Summary” of it as trimmed string & " - Run Time" & following text of first “Run time” of it as trimmed string) of (lines whose (it contains “Run time” and (current date - ((preceding text of first “/” of following text of first “/” of it & " " & (preceding text of first “/” of it) as integer as month as three letters as string & " " & following text of last “/” of it) as date ) of preceding text of first " " of it) >90*day) of file (value of variable “allusersprofile” of environment & “\Application Data\McAfee\DesktopProtection\OnDemandScanLog.txt”))