i have a function (below) which reads the last n lines from a text
file. rather than read the whole line and output it as is, i want to be
able to read the line and split the tab delimited text file so I can
present it in columns, exclude unwanted data etc. can anyone help me
rewrite the javascript function to achieve this?
thx
Chris
function GetLastLines(filespec, lines)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.OpenTextFile(filespec, 1, false);
var saLines = new Array();
while (!f.AtEndOfStream)
saLines[saLines.length] = f.ReadLine();
f.Close( );
var s = "";
for (var i = saLines.length - lines; i < saLines.length; i++)
s += saLines[i] + "<br />";
return s;
}
*** SNIP ***
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><font size=1 face=arial>
<%= GetLastLines("\\\\server\\share\\file.ext", 4) %></font></td></tr>
</table>