By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

Merging multiple text files from different folders

P: 1
Hi everyone,
I have one main folder which contains hundreds of other folders each with a number of text files. My query is I need to merge the text files found in each folder. Is there an easy and simple way using python to merge those texts without doing it manually?
Please help!
Dec 28 '17 #1
Share this Question
Share on Google+
1 Reply


P: 1
Hello here is the Python code for batch merging of files:

Expand|Select|Wrap|Line Numbers
  1. For %%a in (Folder1\*.txt) do type "%%~a" >> "Folder2\%%~nxa"
Jan 2 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.