I am a bit confused… does the version 1.2.3.4 mean that it was successful? If so, try this:
q: (if (not exists file “C:\sample.txt”) then “Audit Fail - File not found” else (if exists (lines whose (it as lowercase contains “” AND it contains “1.2.3.4”) of it) then (“Audit Passed -” & following text of first “” of (it as lowercase) of lines whose (it as lowercase contains “”) of it) else (if exists (lines whose (it as lowercase contains “” AND it does not contain “1.2.3.4”) of it) then (“Audit Passed -” & following text of first “” of (it as lowercase) of lines whose (it as lowercase contains “”) of it) else “Version not found”))) of file "C:\sample.txt"
A: Audit Passed - 1.2.3.4
I added an extra part of the relevance to detect if the file has no “” string and report an error…
Cool! this is the one i’m looking for thanks again! Btw, have change the second Audit Pass to Audit Fail since I was looking for 1.2.3.4 only. thanks again.
q: (if (not exists file “C:\sample.txt”) then “Audit Fail - File not found” else (if exists (lines whose (it as lowercase contains “” AND it contains “1.2.3.4”) of it) then (“Audit Passed -” & following text of first “” of (it as lowercase) of lines whose (it as lowercase contains “”) of it) else (if exists (lines whose (it as lowercase contains “” AND it does not contain “1.2.3.4”) of it) then (“Audit Fail -” & following text of first “” of (it as lowercase) of lines whose (it as lowercase contains “”) of it) else “Version not found”))) of file “C:\sample.txt”