Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007

    Unanswered: Deleting comments from a text files with SQL data

    Hi all,

    Please can you show me how to write a VB6 script for deleting the contents of each element in a text file starting with a double "-". I know you can use the Kill function to delete a file but I need to delete the lines with double "-" in the file.

    Thanks for all your help!

  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    Pseudo code
    Open the input file  (OPEN)
    Open the output file
    Loop through the input File (Do While NOT EOF)
      Read each line from the input file (LINE INPUT)
      If the line begins with "--" do nothing, else
        Print the current line to the output file (PRINT #)
    Continue (LOOP)

    Ref this File I/O Tutorial at our VB sister-site.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts