I can think of 2 ways right off the bat… chose the line with the highest line number, or parse out the time stamps and choose the maximum. The relevance for the time stamp version will be a little more straightforward. If you post an example line I can give you an exact relevance query, but in pseudo code it would look like this:
maximum of ({relevance to extract time stamp string} as time) of lines whose (it contains “Update Finsihed”)…
Some good tips in this post but I need something just a bit different.
I need to search a file to check two things.
that it has a specific string in it
and whether or not that line with the string in it starts with a # or not.
I need to check whether or not this particular item is commented out and unfortunately since the entire line string is not consistant, I cant check for an exact match with the # in front, so I’m stuck trying to make this like a wildcard lookup.
Some thing like lines starting with “#” and contains “”
Guys… i’m trying to recurse a text file that contains lines of absolute paths… I just want to run it in a loop and return the file sizes of them… Any input?
this code DOES NOT work:
(size of file (lines of file “c:\program files\bigfix enterprise\bes client\searchresults_pst.txt”)) as string & " KB"
I suck… help… too much vb recently, i’m forgetting my bigfix coding skills!
I can think of 2 ways right off the bat… chose the line with the highest line number, or parse out the time stamps and choose the maximum. The relevance for the time stamp version will be a little more straightforward. If you post an example line I can give you an exact relevance query, but in pseudo code it would look like this:
maximum of ({relevance to extract time stamp string} as time) of lines whose (it contains “Update Finsihed”)…
Here’s the line from the log file, for example:
8/28/2008 9:01:52 AM NT AUTHORITY\SYSTEM Update Finished
Following up on this I have the following exists file “C:\Windows\CCM\Inventory\noidmifs\DeptNoID.MIF” whose (exists (line of it) whose (it contains “8083”)) which appears to work just fine, however the second I try to specify an actual line # as so exists file “C:\Windows\CCM\Inventory\noidmifs\DeptNoID.MIF” whose (exists (line of 17) whose (it contains “8083”)) I’m receiving “The operator “line” isn’t defined” Am I just missing something here?
I think you’re very unlikely to have people scroll all the way down a ten-year-old thread to find your reply. I’d suggest you start a new thread for this.
plural “firsts” thanks.
Q: (following texts of firsts " – " of lines of it) of files whose (name of it contains “SAN-boot-review.txt”) of folder "/tmp"
A: hdisk0 Available 32-T1-01 MPIO 2810 XIV Disk – rootvg
A: hdisk4 Available 32-T1-01 MPIO 2810 XIV Disk – altinst_rootvg
Hi, I understand this is quite an old thread, but was wondering if anyone could still help.
Regarding returning lines of a file that contain a string. Please, what if I wanted to return the actual line number of the line that contains the string in the file?
Q: line number of line whose (it as string as lowercase starts with “X-Fixlet-Site-Gather-URL” as lowercase) of file “C:\Program Files (x86)\BigFix Enterprise\BES Client\ActionSite.afxm”
A: 18
T: 26.850 ms
I: singular integer