-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcombine.py
More file actions
20 lines (16 loc) · 775 Bytes
/
combine.py
File metadata and controls
20 lines (16 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
# Specify the directory containing the JSONL files
directory = '/home/REDACTED/Documents/Parsing/Combined/split/splitfinish'
# Specify the output file path
output_file = '/home/REDACTED/Documents/Parsing/regularization.jsonl'
# Create the output file
with open(output_file, 'w', encoding='utf-8') as outfile:
# Loop through each file in the directory
for filename in os.listdir(directory):
if filename.endswith('.jsonl'):
file_path = os.path.join(directory, filename)
# Open the JSONL file and read each line
with open(file_path, 'r', encoding='utf-8') as infile:
for line in infile:
# Write each line to the output file
outfile.write(line)