title: Merging 2 or more text files after edit in VB.net
body: <p>Helo there!</p>
  
  <p>it seems that i am facing a problem with my code in VB.net. Please be patient as i am a complete beginner in programming. I am trying to code a program that will load 2 or more txt files, find and exclude specific lines (starting with some characters or contain some characters) and then merge and save only one file that will contain all the information after the editing (from all the files).</p>
  
  <p>I am using openfiledialog and i have set the multiselect to true. Below is the code for the OpenfileDialog:</p>
  
  <pre><code>        If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
          For Each File In OpenFileDialog1.FileNames
              My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)
          Next
  </code></pre>
  
  <p>If i am correct, it loads the filenames and reads all the text from the files. For the editing i am using the following code:</p>
  
  <pre><code>        Dim outputLines As New List(Of String)()
      For Each line As String In System.IO.File.ReadLines(OpenFileDialog1.FileName)
          Uline1 = line.StartsWith("text1")
          Uline2 = line.StartsWith("text2")
          Uline3 = line.StartsWith("text3")
          Uline4 = line.StartsWith("text4")
          Uline5 = line.StartsWith("text5")
          Uline6 = line.StartsWith("text7")
          Uline7 = line.StartsWith("sometext")
          Trash = line.Contains("^")
  
          If Uline1 Or Uline2 Or Uline3 Or Uline4 Or Uline5 Or Uline6 Or Uline7 Or Trash Then
              outputLines.Remove(line)
          Else
              outputLines.Add(line)
          End If
      Next
  </code></pre>
  
  <p>For the output i am using a savefiledialog with the following code:</p>
  
  <pre><code>    SaveFileDialog1.DefaultExt = "txt"
      SaveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
      SaveFileDialog1.RestoreDirectory = True
      If (SaveFileDialog1.ShowDialog() = DialogResult.OK) Then
          System.IO.File.WriteAllLines(SaveFileDialog1.FileName, outputLines)
  </code></pre>
  
  <p>Although the files are being loaded correctly, the edit seems to happen only in one file (the last selected) and again the program saves only one file.</p>
  
  <p>Could you please point me to the right direction?</p>