|To list first n lines of a text file, use the following script.|
# Script listn.txt
var str file
var int n
# Read file into a variable.
var str content ; cat $file > $content
# List first $n lines to screen.
lex (makestr(int($n))+"]") $content
Script is in biterscripting. Save the script as C:/Scripts/listn.txt. Run the script as
script "C:/Scripts/listn.txt" file("C:/somefolder/somefile.txt") n(2)
Above will list the first 2 lines of file C:/somefolder/somefile.txt. Always include files and paths in double quotes. Similarly, the following command will give you the number of lines present in the file.
The documentation for these commands is at http://www.biterscripting.com/helpp... .