Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Combine the split files into a single file named 'ILtrain2.db.gzip'
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
```python
|
| 5 |
+
import gzip
|
| 6 |
+
import os
|
| 7 |
+
|
| 8 |
+
def combine_files(input_prefix, num_parts, output_file):
|
| 9 |
+
with gzip.open(output_file, 'wb') as f_out:
|
| 10 |
+
for i in range(1, num_parts + 1):
|
| 11 |
+
part_file = f"{input_prefix}_part{i}.gz"
|
| 12 |
+
with gzip.open(part_file, 'rb') as f_in:
|
| 13 |
+
shutil.copyfileobj(f_in, f_out)
|
| 14 |
+
|
| 15 |
+
os.remove(part_file)
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
combine_files('ILtrain2_part', 5, 'ILtrain2.db.gzip')
|
| 19 |
+
```
|