I am combining three text files into one text file and in the one final text file, it needed to be sorted by state alphabetically. How do I get my query to work with the writealltext? My code is below:
Private Sub generatebtn_Click(sender As Object, e As EventArgs) Handles generatebtn.Click
Dim sen = IO.File.ReadLines("C:\temp\Senate113.txt").ToList()
sen.AddRange(IO.File.ReadLines("C:\temp\RetiredSen.txt"))
sen.AddRange(IO.File.ReadLines("C:\temp\NewSen.txt"))
Dim query = From line In sen
Let state = Split(","c)(1)
Let name = Split(","c)(0)
Let party = Split(","c)(2)
Order By state Ascending
Select name, state, party
IO.File.WriteAllLines("Senate114.txt", sen)
End Sub
End Class