hello everyone!
i have a VBSCRIPT that will read the last 6 entries (from bottom to top) of a text file, and then would save the result into a separate text file called "result.txt", and the code look like this:
PHP Code:
Dim arrFileLines()
i = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("d:\backup\test.txt", 1)
' create the output file here
Set objoutputFile = objFSO.CreateTextFile("d:\backup\result.txt")
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
For l = Ubound(arrFileLines)-5 to Ubound(arrFileLines)
' write the output to the file
objoutputFile.writeline arrFileLines(l)
Next
'Close the output file
objoutputFile.close
am trying to modify the code to read only the second line (from bottom to top) of the text file and then save it to separate text file, but i could'nt do it, any help would be appreciated. thanks!