I have a program which generates text files in every some seconds and within few days, the file number reaches to thousands of hundreds. I dont want to merge them into a single files because then file size reaches to over 50 Gb. But What I want is to divide and merge those smaller files into some number of files.
For example, I have 10 files and I would like to merge first 5 files to
FileA.txt
, then 3 files to FileB.txt
and rest two files to FileC.txt
.
Is this possible to achieve in Python without copying and pasting files to folder and then merge?