We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents edc2dcd + 34755c5 commit f7a7055Copy full SHA for f7a7055
scripts/prepare.py
@@ -9,6 +9,14 @@
9
10
data_file_path = os.path.join('data', 'subdivision-codes.csv')
11
12
+def fix_crlf(csv_file, output_file):
13
+ # Read the CSV file and replace \r\n with \n
14
+ with open(csv_file, "rb") as f:
15
+ content = f.read().replace(b"\r\n", b"\n")
16
+
17
+ with open(output_file, "wb") as f:
18
+ f.write(content)
19
20
def fix_multiline_csv(file_path):
21
with open(file_path, 'r', encoding='utf-8') as infile:
22
lines = infile.readlines()
@@ -168,7 +176,7 @@ def process(extracted_files):
168
176
# Loop over the file paths and call remove_double_quotes for each
169
177
for file_path in file_paths:
170
178
remove_double_quotes(file_path)
171
-
179
+ fix_crlf(file_path, file_path)
172
180
fix_multiline_csv(data_file_path)
173
181
174
182
for file_path in cleaned_files:
0 commit comments