title: Combine three text files
body: <p>How does one combine three text files together into one? I was also trying to make it alphabetical by state in the new text file. I figured how to combine two but three I am getting lost.</p>
  <pre><code>Public Class newsenatefrm
      Dim current() As String = IO.File.ReadAllLines(&quot;Senate113.txt&quot;)
      Dim retired() As String = IO.File.ReadAllLines(&quot;RetiredSen.txt&quot;)
      Dim newSen() As String = IO.File.ReadAllLines(&quot;NewSen.txt&quot;)
  
      Dim queryCurrent = From line In current
                         Let state = Split(&quot;,&quot;c)(1)
                         Let name = Split(&quot;,&quot;c)(0)
                         Let party = Split(&quot;,&quot;c)(2)
                         Order By state Ascending
                         Select state, name, party
  
      Dim queryRetired = From line In retired
                         Let state = Split(&quot;,&quot;c)(1)
                         Let name = Split(&quot;,&quot;c)(0)
                         Let party = Split(&quot;,&quot;c)(2)
                         Order By state Ascending
                         Select state, name, party
  
      Dim queryNew = From line In newSen
                     Let state = Split(&quot;,&quot;c)(1)
                     Let name = Split(&quot;,&quot;c)(0)
                     Let party = Split(&quot;,&quot;c)(2)
                     Order By state Ascending
                     Select state, name, party
      Private Sub generatebtn_Click(sender As Object, e As EventArgs) Handles generatebtn.Click
  
          IO.File.WriteAllText(&quot;Senate114.txt&quot;)
      End Sub
  End Class
  </code></pre>
  <p>I included sample text from the three text files below:</p>
  <blockquote>
  <p>Senate113.txt:<br>
  Richard Shelby,Alabama,R<br>
  Bernard Sanders,Vermont,I<br>
  Kristen Gillibrand,New York,D<br></p>
  </blockquote>
  <blockquote>
  <p>Retired.txt:<br>
  John Rockefeller,West Virginia,D<br>
  Tom Coburn,Oklahoma,R<br>
  Carl Levin,Michigan,D</p>
  </blockquote>
  <blockquote>
  <p>NewSen.txt:<br>
  Shelly Capito,West Virginia,R<br>
  Steve Daines,Montana,R<br>
  Gary Peters,Michigan,D</p>
  </blockquote>