I am building an analyses to generate a result from a string of text in a .txt files. I can do the single variable style of this:
Q:IF exist lines whose (it as lowercase contains “TheTextIWant” as lowercase of file “C:\folder” THEN “Bazinga” ELSE “N/A”
This kind formatting works for me, but I need to extend that, and each format I try fails. How do I have it look for multiple values?
Such as:
Q:IF exist lines whose (it as lowercase contains “TheTextIWant” as lowercase of file “C:\folder” THEN “Bazinga” ELSE IF exist lines whose (it as lowercase contains “SomeOtherText” as lowercase) of file “C:\folder” THEN “BigFix Rocks” ELSE IF exist lines whose (it as lowercase contains “YetOtherText” as lowercase) of file “C:\folder” THEN “It’s Called Tivoli” ELSE “N/A”
I am reviewing my documentation, but I am struggling to get the right formatting here. Thanks for any assistance!!
IF exist lines whose (it as lowercase contains “TheTextIWant” as lowercase) of file “C:\Test\test.txt” THEN “Bazinga” ELSE IF exist lines whose (it as lowercase contains “SomeOtherText” as lowercase) of file “C:\Test\test.txt” THEN “BigFix Rocks” ELSE IF exist lines whose (it as lowercase contains “YetOtherText” as lowercase) of file “C:\Test\test.txt” THEN “It’s Called Tivoli” ELSE “N/A”
Or to tidy it up a bit by just having one reference to the file use
(IF exist lines whose (it as lowercase contains “TheTextIWant” as lowercase) of it THEN “Bazinga” ELSE IF exist lines whose (it as lowercase contains “SomeOtherText” as lowercase) of it THEN “BigFix Rocks” ELSE IF exist lines whose (it as lowercase contains “YetOtherText” as lowercase) of it THEN “It’s Called Tivoli” ELSE “N/A”) of file “C:\Test\test.txt”
Thanks for the relevance. However, I am still having some issues. Even when the search string is present in the file, the result is the last ELSE (N/A) so it’s not detecting correctly. Let me give you a real-time example:
The text file reads:
ERROR: An error occurred (code 0x80070057):
The parameter is incorrect.
The line that should pick that up is:
(IF exist lines whose (it as lowercase contains “ERROR: An error occurred (code 0x8070057)” as lowercase) of it THEN “Needs Partition” ELSE IF exist lines whose (it as lowercase contains “Bazinga” as lowercase)
but yet it results with:
A: N/A
I tried it as admin, I even ran it through the system client, still the same result. Any thoughts?