title: Delete line in TXT file but keep everything else
body: <p>Hey all i am trying to figure out a way to delete something inside a text file but keep everything around it.</p>
  
  <p>An example of this would be:</p>
  
  <pre><code>SDfmifgn349234024jn4tnge0b04tnEFGm34tmn34t0egonkerglnk
  318erg4nergpERGhmboergn4t34tmg054
  fg94t34tskmsdglnEGgjr894ERG94mrg34tSDFS$45352ty
  GGreerkg0gm4m505556g0fdg6555fbd105f1g
  </code></pre>
  
  <p>And say i wanted to delete the <strong>318erg4nergpERGhmboergn4t34tmg054</strong> and therefore it would turn out to be saved as:</p>
  
  <pre><code>SDfmifgn349234024jn4tnge0b04tnEFGm34tmn34t0egonkerglnk
  fg94t34tskmsdglnEGgjr894ERG94mrg34tSDFS$45352ty
  GGreerkg0gm4m505556g0fdg6555fbd105f1g
  </code></pre>
  
  <p>But i am unable to find out how to go about doing that!</p>
  
  <p>I've tried this code below that i found:</p>
  
  <pre><code>    Dim dir As New DirectoryInfo(defaultNetworkDrive)
  
              For Each file As FileInfo In dir.GetFiles()
                  If file.Extension = ".txt" Then
                      Dim ioFile As New StreamReader(defaultNetworkDrive &amp; file.Name)
  
                      Dim ioLine As String ' Going to hold one line at a time
                      Dim ioLines As String ' Going to hold whole file
                      ioLine = ioFile.ReadLine
                      ioLines = ioLine
  
                      While Not ioLine = ""
                          ioLine = ioFile.ReadLine
                          ioLines = ioLines &amp; vbCrLf &amp; ioLine
                      End While
  
                      MsgBox(ioLines) 'SHOWS all the lines in the TXT file
  
                      If InStr(1, ioLines, encryptedText, vbTextCompare) &lt;&gt; 0 Then
                          MsgBox("True")
                      Else
                          MsgBox("False")
                      End If
  
                      'Dim sw As StreamWriter = file.CreateText("input.txt")
                      'sw.Write(ioLines)
                      'sw.Close()
  
                      ioFile.Close()
                  End If
              Next
  </code></pre>
  
  <p><strong>I do find it</strong> and its <strong>TRUE</strong> but i am not sure how to go about just <strong>deleting that line</strong> then <strong>saving it</strong>!</p>
  
  <p>Any help would be great! :o)</p>
  
  <p>David</p>