Deleting blank lines from text file

Discussion in 'ASP General' started by Joey Martin, Aug 30, 2005.

  1. Joey Martin

    Joey Martin Guest

    I have a text file being create with the FileSystemObject. It's being
    built based on results from a SQL query. All this is working fine, but
    so that I have a carriage return VBCRLF at the end of each row, I have
    an empty row at the end of my text file. How do I delete this last line?

    Here is the end of my script:
    csvText=csvText & vbcrlf
    rs.movenext
    loop

    How should I do this? Thanks!!



    *** Sent via Developersdex http://www.developersdex.com ***
    Joey Martin, Aug 30, 2005
    #1
    1. Advertising

  2. Joey Martin

    Evertjan. Guest

    Joey Martin wrote on 30 aug 2005 in
    microsoft.public.inetserver.asp.general:

    > I have a text file being create with the FileSystemObject. It's being
    > built based on results from a SQL query. All this is working fine, but
    > so that I have a carriage return VBCRLF at the end of each row, I have
    > an empty row at the end of my text file. How do I delete this last line?
    >
    > Here is the end of my script:
    > csvText=csvText & vbcrlf
    > rs.movenext
    > loop


    csvText = left(csvText, len(csvText)-2)

    >
    > How should I do this? Thanks!!


    not tested

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
    Evertjan., Aug 30, 2005
    #2
    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. Ruben
    Replies:
    6
    Views:
    588
    Carlos Ribeiro
    Sep 13, 2004
  2. pozz

    Deleting first N lines from a text file

    pozz, Nov 15, 2011, in forum: C Programming
    Replies:
    26
    Views:
    1,939
    Dr Nick
    Dec 16, 2011
  3. Replies:
    7
    Views:
    469
    Peter J. Acklam
    Sep 12, 2005
  4. Cah Sableng
    Replies:
    0
    Views:
    230
    Cah Sableng
    Apr 23, 2007
  5. crea
    Replies:
    2
    Views:
    397
    Nobody
    Dec 28, 2012
Loading...

Share This Page