From a0f062cdf5ae15cb0ff2206fe16bd555f995f747 Mon Sep 17 00:00:00 2001 From: scoobybejesus Date: Sat, 14 Nov 2020 20:35:25 -0500 Subject: [PATCH] Script: newline caused append behavior (undesirable). --- clean_input_csv.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clean_input_csv.py b/clean_input_csv.py index c962539..152a601 100755 --- a/clean_input_csv.py +++ b/clean_input_csv.py @@ -106,8 +106,7 @@ stage3 = "InputFile-pycleaned.csv" ## i.e., (1.01) -> -1.01 (1,000.00) -> -1000.00 -with open(stage2) as fin, open(stage3, 'w', newline='') as fout: - +with open(stage2) as fin, open(stage3, 'w') as fout: rdr = csv.reader(fin, quoting=csv.QUOTE_ALL) wtr = csv.writer(fout) @@ -158,4 +157,4 @@ with open(stage2) as fin, open(stage3, 'w', newline='') as fout: os.remove(stage1) os.remove(stage2) -print("Input file ready") \ No newline at end of file +print("Input file ready")