Analysis to output 2 settings from a text file

I’m trying to create a property to display 2 values from a text file.
For example:
I want to display the “Source IP:” and “Source:” from an output text file on the local C: drive.

the is the full content of the file; in “C:\temp\w3tm.txt”

Leap Indicator: 0(no warning)
Stratum: 4 (secondary reference - syncd by (S)NTP)
Precision: -23 (119.209ns per tick)
Root Delay: 0.0568336s
Root Dispersion: 8.1343095s
ReferenceId: 0x0A080C1F (source IP: 10.10.10.10)
Last Successful Sync Time: 6/5/2020 2:27:41 PM
Source: Servername.domain.com
Poll Interval: 15 (32768s)

Thanks in advance.

Quick and Dirty …

Lines whose ((it as string as lowercase starts with "source: ") OR (it as string as lowercase contains "source ip:")) of file "C:\temp\w3tm.txt"

I bit more comprehensive and more what I think you were asking for …

(if (it as string as lowercase starts with "source: ") then (it) else (substrings before ")" of (substrings after "(" of it))) of lines whose ((it as string as lowercase starts with "source: ") OR (it as string as lowercase contains "source ip:")) of file "C:\temp\w3tm.txt"

Thank you.so much! I will spin my vm and try both.

I was able to pull the setting, but only one at a time with:
If (exists file “c:\ocd\w32tm.txt”) then (line 6 of file “c:\ocd\w32tm.txt”) else "No Result"
If (exists file “c:\ocd\w32tm.txt”) then (line 8 of file “c:\ocd\w32tm.txt”) else “No Result”

But I’m not able to pull both line 6 and line 8 within the same property.

It didn’t work. This is the result.

Q: Lines whose ((it as string as lowercase starts with "source: ") OR (it as string as lowercase contains “source ip:”)) of file "C:\temp\w3tm.txt"
E: Singular expression refers to nonexistent object.

The one I was using that pull only 1 line worked from the same file and path.
Q: If (exists file “c:\temp\w32tm.txt”) then (line 8 of file “c:\temp\w32tm.txt”) else "No Result"
A: Source: Servername.domain.com
T: 0.536 ms

You misspelled the filename in the first query. Left the “2” out.

THAT DID IT!!! Good catch.

Q: Lines whose ((it as string as lowercase starts with "source: ") OR (it as string as lowercase contains “source ip:”)) of file "C:\temp\w32tm.txt"
A: ReferenceId: 0x0A080C1F (source IP: 10.10.10.10)
A: Source: Servername.domain.com
T: 0.951 ms

Thank you both so much!!!

1 Like