From 965ac504daf608395a35ce00c4345a45a90db5f3 Mon Sep 17 00:00:00 2001 From: Christian Ramseyer Date: Mon, 23 Jul 2018 13:50:43 +0200 Subject: [PATCH] Fix delimiter option not considered (#51) --- es2csv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/es2csv.py b/es2csv.py index 054d1ec..5022142 100755 --- a/es2csv.py +++ b/es2csv.py @@ -209,7 +209,7 @@ def write_to_csv(self): self.num_results = sum(1 for line in codecs.open(self.tmp_file, mode='r', encoding='utf-8')) if self.num_results > 0: output_file = codecs.open(self.opts.output_file, mode='a', encoding='utf-8') - csv_writer = csv.DictWriter(output_file, fieldnames=self.csv_headers) + csv_writer = csv.DictWriter(output_file, fieldnames=self.csv_headers, delimiter=unicode(self.opts.delimiter)) csv_writer.writeheader() timer = 0 widgets = ['Write to csv ',