Python Forum
How to merge all the files in a directory in to one file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to merge all the files in a directory in to one file
#1
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.
Reply
#2
Please show your attempted code, any error tracebacks, and where you think the problem lies.
Reply
#3
(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
Reply
#4
(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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  merge two csv files into output.csv using Subprocess mg24 1 59 6 hours ago
Last Post: DeaD_EyE
  no such file or directory in SFTP saisankalpj 2 163 Nov-25-2022, 11:07 AM
Last Post: DeaD_EyE
Photo Making Zip file of a file and Directory Nasir 2 251 Oct-07-2022, 02:01 PM
Last Post: Nasir
  Read directory listing of files and parse out the highest number? cubangt 5 331 Sep-28-2022, 10:15 PM
Last Post: Larz60+
  Merge all json files in folder after filtering deneme2 10 645 Sep-18-2022, 10:32 AM
Last Post: deneme2
  Failed to execute child process (No such file or directory) uriel 1 292 Sep-15-2022, 03:48 PM
Last Post: Gribouillis
  Need Help: FileNotFoundError:[Errno 2] No such file or directory python202209 5 462 Sep-12-2022, 04:50 AM
Last Post: python202209
  Merge htm files with shutil library (TypeError: 'module' object is not callable) Melcu54 5 476 Aug-28-2022, 07:11 AM
Last Post: Melcu54
  importing functions from a separate python file in a separate directory Scordomaniac 3 634 May-17-2022, 07:49 AM
Last Post: Pedroski55
  How to read python shortcut target profile directory of Chrome Ink file sunny9495 1 698 Apr-12-2022, 06:12 PM
Last Post: sunny9495

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020