File size: 522 Bytes
f8d5951
2d7c83d
 
 
 
 
50aebbf
2d7c83d
 
 
 
 
 
 
 
 
 
 
7643d9f
2d7c83d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
## Combine the split files into a single file named 'ILtrain2.db.gz'


```python
import gzip
import os
import shutil

def combine_files(input_prefix, num_parts, output_file):
    with gzip.open(output_file, 'wb') as f_out:
        for i in range(1, num_parts + 1):
            part_file = f"{input_prefix}_part{i}.gz"
            with gzip.open(part_file, 'rb') as f_in:
                shutil.copyfileobj(f_in, f_out)
                
            os.remove(part_file)


combine_files('ILtrain2', 5, 'ILtrain2.db.gz')
```