Navigating the Memory Buffer
Posted on 2003-10-27
It seams apparent that the Windows Scripting Host (WSH) does not contain sufficient properties or methods in connection with manipulating the contents of a text file. I have no problem opening a text file and reading line by line or the entire file into memory at once. From there I can execute replace functions with RegExp and Replace().
But how can I navigate the file pointer around to pluck individual elements from the bufferized file? I need to be able to do this in order to extract needed data and write it to a new file.
All my VBScript, WSH and ASP web and book resources happily point out that this is a breeze once the datastream has been fed into the memory buffer, but no information or direction is supplied on how to work with a bufferized file beyond the range of arsenal offered by WSH and VBScript. Have I missed something in VBScript, cause I am almost certain I haven't missed anything in WSH?
In summary, once the file is in memory, I need to be able to position the pointer at specific coordinates using either variable logic or coordinate numbers, and then read from there forward. Preferably, I would process line by line and need to have the ability to remove blank lines. Does such a command/function even existing within the scripting domain to do this?
Please point me in the right direction and/or provide examples. Allow me to express my thanks and gratitude in advance.