Results 1 to 2 of 2

Thread: Remove spaces in text file

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2001
    Location
    Plymouth, UK
    Posts
    45

    Remove spaces in text file

    How do I open a text file and before I begin to interogate it remove all empty lines?
    "Do, or do not, there is no try".

    "Never give up. Never surrender!"

  2. #2
    Matthew Gates
    Guest
    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.     Dim sText As String
    4.  
    5.     Open "C:\MyTextFile.txt" For Input As #1
    6.         sText = Input(LOF(1), 1)
    7.     Close #1
    8.  
    9.     sText = Replace(sText, Chr$(32), vbNullString)
    10.  
    11. End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width