I need your help to get the first 20 lines from the XML file.
First I need to search install.xml file whose directory path is “/”(absolute path is missing) but that XML file have some unique keyword like “IBM” “Webserver” etc,with the help of unique keywords if that file found on the server then we need to get first 20 lines from that XML file.
As orbiton suggests, it would be good to understand what specific information/data/fields you’re trying to extract from the XML. While it is certainly possible to return the first 20 lines, why not have BigFix parse the data for you so that it is more meaningful (and efficient)? This is where the XML inspectors can come into play.
In the meantime, if you really just want an example of returning the first 20 lines of a file (not really recommended), here are two:
First 20 lines of a given file:
lines (integers in (1,20) of file "foo.txt" of folder "/tmp"
First 20 lines of the most recent Client log:
locked lines (integers in (1,20)) of files ((it & ".log") of (year of it as string & month of it as two digits & day_of_month of it as two digits) of current date) of folders "Logs" of folders "__Global" of data folders of client
Please correct me if i’m wrong @gsing1987 but it sounds like me that you want to look at the install.xml file for Websphere and if the install path is ‘/’ then get the first 20 lines of the xml back in a string. Looking at the example listed in Websphere Install.xml It looks like the InstallLocation property is what your looking for. Let me know if this works for you.
**Note: You will need to change the path to wherever the install.xml file is located. ** Also in the example install.xml it didn’t look like there was any valuable information the the first 20 lines so i’m not sure how much that is going to help you.
if exists (lines whose (it as string as lowercase contains “installLocation=‘/’” as lowercase) of file “C:\Support\debugtest\install.xml”) then locked lines (integers in (1,20)) of file “C:\Support\debugtest\install.xml” Else “Location not ‘/’”
q: node values of xpaths "agent-input/profile/@installLocation" of xml document of file "install.xml" of parent folder of client
A: C:\Program Files\IBM\WebSphere\AppServer