*Carol* wrote:
With ASP, I am generating a huge CSV file. It is to large to open in
notepad.
Can I use the Filesystem Scripting Object to read the very last line
of the file and delete the very last character?
I am hoping the DSO will not have to read thru the whole file. it is
probably way to big.
You could use FSO to:
Create a new file ready for writing to.
Open the original file for reading.
Repeating until the end of the original file {
Read a single line at a time.
If the line is the last line in the file perform the modification
to that line that you wanted.
Write the line to the new file.
}
Close the new file.
On successful completion delete the original file.
Move the new file to a original files location.
Reading a single line at a time from a very large file does not require
significant resources to execute, whereas using the ReadAll() method
could bring a system to its knees in such a case.
--
Andrew Urquhart
- FAQ:
www.aspfaq.com
- Archive:
www.tinyurl.com/38kzx (Google Groups)
- Contact me:
http://andrewu.co.uk/contact/
- Apologies for the wrong timestamp on my post - blame my ISP