Merging multiple text files from different folders

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • faresrez
    New Member
    • Dec 2017
    • 1

    Merging multiple text files from different folders

    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!
  • micah12
    New Member
    • Jan 2018
    • 1

    #2
    Hello here is the Python code for batch merging of files:

    Code:
    For %%a in (Folder1\*.txt) do type "%%~a" >> "Folder2\%%~nxa"

    Comment

    Working...