nthlinef()
Return specified lines from a text string.
Syntax
Parameter
Parameter | Definition |
---|---|
text | text to be separated into lines by the nthlinef() function The text can be a text string enclosed in double quotes, or one or more PSL commands that produce text as output. |
lines | integer list specifying the line numbers nthlinef() should look for in text*Valid Values* |
separator | optional character that should be placed between each field of nthlinef() output*Default* |
Description
The nthlinef() function returns the lines of text separated by new-line characters. If you specify a separator, thenthlinef() function will use separator to separate lines.
BMC recommends you to use nthlinef() function to be consistent with other PSL functions.
Example
The following PSL script prints the top five processes executing on a Unix system:
print(nthlinef(system("ps -eaf"),"2-6"));
The following example illustrates the difference between the nthlinef() function and the nthline() function:
A = nthline(string,3);
B = nthlinef(string,3);
print("nthline() 3rd string argument is : ",A,"\n");
print("nthlinef() 3rd string argument is : ",B,"\n");