WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: jtrask on June 03, 2015, 07:04:13 AM

Title: Concatenating Mulitple Text Files
Post by: jtrask on June 03, 2015, 07:04:13 AM
The consensus on the Internet seems to be that the best way to concatenate multiple text files into a single file, read each text files one at a time, and write the contents of each to the new file.  Some methods seem fancier than others, but they're  each just doing this same thing. 

Is this indeed the way to go?
Title: Re: Concatenating Mulitple Text Files
Post by: JTaylor on June 03, 2015, 07:24:06 AM
Maybe use FileAppend()?

Jim
Title: Re: Concatenating Mulitple Text Files
Post by: jtrask on June 05, 2015, 06:25:24 AM
Thank you.  How did I not know about this?  It was so much easier than the other method, and faster too.
Title: Re: Concatenating Mulitple Text Files
Post by: DAG_P6 on June 19, 2015, 12:06:34 PM
In a batch file, you can string them together with plus signs; I have concatenated up to about four files this way.

One thing to be aware of is that a simple concatenation of delimited ASCII files that have column labels in their first row is unwise, unless the application that uses the concatenated file handles embedded label rows gracefully. This is a problem that has arisen so often for me that I created ManyCat.exe, a custom tool that performs this task correctly, so long as all files contain the same columns, in the same order.