Forum Discussion
Nathan Wendel
Jul 27, 2018Copper Contributor
Combining Text Files Into Single CSV
Hi, I have a business situation where I have to combine several TXT files into one CSV. I'm looking for a way to automate the process of combining them as much as possible, even if it means a 3rd par...
- Jul 28, 2018
Hi Nathan,
Are you on Windows or on Mac?
Assuming all you csv file are in one folder for Windows you may use command line like
copy *.csv output.csv
to combine all files. The only point first row of each file will be kept within the resulting file, but most probably you may find more complicated command to resolve that.
I believe something similar shall be for Mac, that is Unix after all.
For Windows you may use Power Query to combine and transform, if necessary, all your files in one resulting Excel table, copy of that resulting file you may save as csv. See, for example, https://www.myonlinetraininghub.com/power-query-get-files-from-a-folder.
Not sure if Power Query is available for Mac now.
SergeiBaklan
Jul 28, 2018MVP
Hi Nathan,
Are you on Windows or on Mac?
Assuming all you csv file are in one folder for Windows you may use command line like
copy *.csv output.csv
to combine all files. The only point first row of each file will be kept within the resulting file, but most probably you may find more complicated command to resolve that.
I believe something similar shall be for Mac, that is Unix after all.
For Windows you may use Power Query to combine and transform, if necessary, all your files in one resulting Excel table, copy of that resulting file you may save as csv. See, for example, https://www.myonlinetraininghub.com/power-query-get-files-from-a-folder.
Not sure if Power Query is available for Mac now.
Nathan Wendel
Jul 30, 2018Copper Contributor
Hi Sergei,
Thank you for that, I'm on PC and Power Query does pretty much what I need as it turns out. Much simpler than I imagined.
Thanks again for your help!