Skip to content

Commit a70b52c

Browse files
Fixed newlines embedded in remarks by replacing with space
1 parent d857687 commit a70b52c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dms_datastore/download_smscg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def main(base_dir=".", outfile="dms_smscg_gate.csv"):
1919
os.makedirs(convert_dir, exist_ok=True)
2020
df0 = download_and_parse_archived_pdf(raw_dir)
2121
df1 = download_and_parse_active_gate_log(raw_dir)
22-
df_final = reconcile_archive_with_new(df0, df1)
22+
df_final = reconcile_archive_with_new(df0, df1)
23+
df_final["remarks"] = df_final["remarks"].str.replace("\n", " ", regex=False).str.replace("\r", " ", regex=False)
2324
# Write CSV with only "remarks" and "user_remarks" quoted
2425
#df_final = _quote_selected_columns(df_final, ["remarks", "user_remarks"])
2526
outfile = os.path.join(convert_dir, outfile)
@@ -56,7 +57,7 @@ def reconcile_archive_with_new(df_archive,df_new):
5657
# Ensure the time index is sorted and unique
5758
df_final = df_final[~df_final.index.duplicated(keep="last")]
5859
df_final = df_final.sort_index()
59-
60+
6061
return df_final
6162

6263
def download_and_parse_active_gate_log(raw_dir="raw"):

0 commit comments

Comments
 (0)