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. Advertisements

  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. Advertisements

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:
    736
    Carlos Ribeiro
    Sep 13, 2004
  2. Murali
    Replies:
    2
    Views:
    776
    Jerry Coffin
    Mar 9, 2006
  3. Harry Barker
    Replies:
    2
    Views:
    663
    Alf P. Steinbach
    Apr 19, 2006
  4. Horacius ReX

    Deleting lines from a file

    Horacius ReX, Dec 17, 2007, in forum: Python
    Replies:
    8
    Views:
    363
    Michael Bentley
    Dec 17, 2007
  5. pozz

    Deleting first N lines from a text file

    pozz, Nov 15, 2011, in forum: C Programming
    Replies:
    26
    Views:
    2,563
    Dr Nick
    Dec 16, 2011
  6. Replies:
    7
    Views:
    621
    Peter J. Acklam
    Sep 12, 2005
  7. Cah Sableng
    Replies:
    0
    Views:
    411
    Cah Sableng
    Apr 23, 2007
  8. crea
    Replies:
    2
    Views:
    610
    Nobody
    Dec 28, 2012
Loading...