Python Forum

Full Version: How to merge all the files in a directory in to one file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a bunch of .log in the directory /home/vs/vs_work2/Chi_DEPB/
I want to merge them into a single file.

output_file.txt : Contents, all the merged files.
Please show your attempted code, any error tracebacks, and where you think the problem lies.
(Dec-09-2020, 09:04 PM)Larz60+ Wrote: [ -> ]Please show your attempted code, any error tracebacks, and where you think the problem lies.

This is my attempted code but.

Quote:cat /home/vs/vs_work2/Chi_DEPB/*.log > output_file.txt
(Dec-09-2020, 09:04 PM)Larz60+ Wrote: [ -> ]Please show your attempted code, any error tracebacks, and where you think the problem lies.

in this thread, I have explained the complete question

https://python-forum.io/Thread-Merging-a...rmanceINFO