I use this code to list all those txt that are in the directory of the indicated path
from glob import glob
path_directory = 'Part001/*.txt'
list_files = glob(path_directory)
for f in list_files:
print(f)
I need help to be able to merge all the listed txt into a single txt that contains all the text lines. Something like this:
In 31Aug21.txt
Hello
Hello!
Hello, Tell me about something
In 04Sep21.txt
Computer equipment has evolved in recent decades.
Perfect Orbit
In 05Sep21.txt
The sky is blue
the computer is really useful
And all the lines of the listed txt should be written in a new txt, like this:
Hello
Hello!
Hello, Tell me about something
Computer equipment has evolved in recent decades.
Perfect Orbit
The sky is blue
the computer is really useful