This seems like it should be a simple process but I’m having trouble
I need to combine all *. Txt files in a folder for processing. They all have the same header row so just keeping one instance of the header row, then combining all the data fields so there are no duplicated headers. What’s the best way to do this?
Eg.
File1.txt
File2.txt
File3.txt
Read all files as one datatable (or combine if easier then delete combine file)
Name | Address
Field1a | Field1b
Field2a | Field2b
Name | Address
Field3a | Field3b
Field4a | Field4b
Name | Address
Field5a | Field5b
Field6a | Field6b
Thanks all! I was able to solve using the first suggestion but I included a File Counter + Row Counter and inside each For Each loop, I increment the counters.
Then I basically have an If FileCounter>1 and RowCounter=1 (The header row of other files) then do nothing, so it skips the header row of each additional file, otherwise append line.