Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > FSO delete the very last character in tgext file

Reply
Thread Tools

FSO delete the very last character in tgext file

 
 
Carol
Guest
Posts: n/a
 
      07-28-2004
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.

Thank youi very much


 
Reply With Quote
 
 
 
 
Phill. W
Guest
Posts: n/a
 
      07-29-2004
"Carol" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> With ASP, I am generating a huge CSV file. It is to large to open in
> notepad.


That's big!

> Can I use the Filesystem Scripting Object to read the very last line of
> the file and delete the very last character?


You'd be far better off changing the routine that writes it to suppress
this last character, whatever that might be.

HTH,
Phill W.


 
Reply With Quote
 
 
 
 
Carol
Guest
Posts: n/a
 
      07-29-2004
good to know . thanks you very much. One line at a time. i think I could
handle that since it is written one line at a time in about 15 mintes.

"Andrew Urquhart" <(E-Mail Removed)> wrote in
message newsu5Oc.150$(E-Mail Removed)...
> *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
>
>



 
Reply With Quote
 
Carol
Guest
Posts: n/a
 
      07-29-2004
If i read one line at a time, how will I know when I hit the last line?

"Andrew Urquhart" <(E-Mail Removed)> wrote in
message newsu5Oc.150$(E-Mail Removed)...
> *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
>
>



 
Reply With Quote
 
Carol
Guest
Posts: n/a
 
      07-30-2004
thanks

"Andrew Urquhart" <(E-Mail Removed)> wrote in
message news:t6fOc.443$(E-Mail Removed)...
> *Carol* wrote:
> > If i read one line at a time, how will I know when I hit the last
> > line?

>
>

http://msdn.microsoft.com/library/en...ndofstream.asp
> --
> Andrew Urquhart
> - Contact me: http://andrewu.co.uk/contact/
> - 'Staccato signals of constant information
> A loose affiliation of millionaires and billionaires' - Paul Simon
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to replace the last (and only last) character in a string? Johny Python 8 05-03-2007 09:24 PM
remove the last character or the newline character? Daniel Mark Python 6 09-28-2006 02:40 PM
Error removing last vbCrLf character from a text file created by FSO CreateTextFile Andyza ASP General 4 02-17-2006 03:09 PM
Quick Book file access very very very slow Thomas Reed Computer Support 7 04-09-2004 08:09 PM
Multiple delete of files with FSO error NIck ASP General 0 07-15-2003 02:30 PM



Advertisments