Hi all
I have the following code to combine all .txt files in a folder into a single .txt file :
However in the process I also combine all the headers in the first line of all the files into the new .txt file.Code:Dim path As String = "D:\Wingerdbou\Lutzville2\InvoerDataFiles\Ander Organisasies\Wesbank\HistorieseFiles\" Dim topath As String = "D:\Wingerdbou\Lutzville2\InvoerDataFiles\Ander Organisasies\Wesbank\HistorieseFiles\" Dim files As String = "*.txt" Dim txtFiles() As String txtFiles = Directory.GetFiles(path, files) Using writer As New StreamWriter(topath & "\Combined.txt") For i As Integer = 0 To txtFiles.Length - 1 Using reader As StreamReader = File.OpenText(txtFiles(i)) writer.Write(reader.ReadToEnd()) End Using Next i End Using
I just cannot figure out how to use only one column header. The data structure of the files are identical.
Any help would be appreciated.
Regards




Reply With Quote
