Parse text from file in __Download folder

Hello,

I’m looking to parse a particular line of text from a file that’s stored in the “C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\CustomSite_Hughes_BigFix_Content_Dev__Download” folder path. How can I accomplish this?

So far I have-
if exists file (( (Program Files (x86)\BigFix Enterprise\BES Client__BESData\CustomSite_Hughes_BigFix_Content_Dev__Download) of folder “C:”) & (whose (name of it starts with “abcd”))) then ((following text of last " " of line whose (it contains “Result”) of file) as string else -1

Thank you,
Jennifer

Please format code using the button that looks like </> - it helps to preserve things like backslashes that appear to be missing from your code.

When using an if… then… else… both evaluation paths have to return the same type - you are returning a string from the ‘then’ and an integer from the ‘else’.

You also have, in the ‘then’ path ((following text of last " " of line whose (it contains “Result”) of file)
This doesn’t have enough information for the inspector to know where to look (it can’t guess at which file you want from the contents of the ‘if’ clause.

As a starting point, try:

(following text of last " " of it) of lines whose (it contains "Result") of files whose (name of it as lowercase starts with "abcd") of folders "__BESDATA\CustomSite_Hughes_BigFix_Content_Dev__Download" of storage folder of client

It won’t return you your -1 if the file doesn’t exist, or the file doesn’t contains a ‘Result’ line though.