I’m new to BigFix and have been reading documentation and forums trying to figure out a way to do the following:
I have a text document say filename.txt on all the computers with some information like this, somewhere in the file but not necessarily in the same location from computer to computer:
=======================================
Irrelevant information to my need
…
…
Category Name:
Scope: Information Information Information
…
…
More irrelevant information to my need
=======================================
I am trying to write a fixlet that would be able to go to each system find the line with “Category Name:” (which is unique in the file) and then retrieving the next line starting “Scope: Information Information Information”
Is there anyway to do this?
Most I could do was “lines of file filename.txt” but I don’t need the whole text file information which is a lot of information.
Here are some example statements for you. The one you want is at the end.
q: if (exists file “c:\temp\filename.txt”) then (“Place holder for the statement”) else (“No file”)
q: (line number of lines whose (it starts with “Category Name:”) of file “c:\temp\filename.txt”) + 1
q: lines whose (line number of it = 999) of file “c:\temp\filename.txt”
q: lines whose (line number of it = (line number of lines whose (it starts with “Category Name:”) of file “c:\temp\filename.txt”) + 1) of file “c:\temp\filename.txt”
q: if (exists file “c:\temp\filename.txt”) then (lines whose (line number of it = (line number of lines whose (it starts with “Category Name:”) of file “c:\temp\filename.txt”) + 1) of file “c:\temp\filename.txt”) else (“No file”)