FSO delete the very last character in tgext file

Discussion in 'ASP General' started by Carol, Jul 29, 2004.

  1. Carol

    Carol Guest

    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
     
    Carol, Jul 29, 2004
    #1
    1. Advertising

  2. Carol

    Phill. W Guest

    "Carol" <> wrote in message
    news:...
    > 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.
     
    Phill. W, Jul 29, 2004
    #2
    1. Advertising

  3. Carol

    Carol Guest

    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" <> wrote in
    message news:xu5Oc.150$...
    > *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
    >
    >
     
    Carol, Jul 29, 2004
    #3
  4. Carol

    Carol Guest

    If i read one line at a time, how will I know when I hit the last line?

    "Andrew Urquhart" <> wrote in
    message news:xu5Oc.150$...
    > *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
    >
    >
     
    Carol, Jul 29, 2004
    #4
  5. Carol

    Carol Guest

    Carol, Jul 30, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raymond Arthur St. Marie II of III

    very Very VERY dumb Question About The new Set( ) 's

    Raymond Arthur St. Marie II of III, Jul 23, 2003, in forum: Python
    Replies:
    4
    Views:
    518
    Raymond Hettinger
    Jul 27, 2003
  2. sangram
    Replies:
    16
    Views:
    2,081
  3. Johny
    Replies:
    8
    Views:
    414
  4. NIck
    Replies:
    0
    Views:
    123
  5. Andyza
    Replies:
    4
    Views:
    333
    Anthony Jones
    Feb 17, 2006
Loading...

Share This Page