From ae1507d478c3a537c2a7a301bbe78da31a991991 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Fri, 28 Oct 2022 11:16:31 +0200 Subject: [PATCH] Concatenate encoder and preset into one column --- concat_csv.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 concat_csv.py diff --git a/concat_csv.py b/concat_csv.py new file mode 100755 index 0000000..85c39b1 --- /dev/null +++ b/concat_csv.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import os + +import csv + +file = "/home/marc/Dokumente/v0.0.1a2-data-1666552071.csv" + +with open(file, "r") as f: + reader = csv.reader(f) + output = os.path.splitext(file)[0] + "-joined.csv" + with open(output, "w") as file: + writer = csv.writer(file) + for row in reader: + new_row = [" ".join([row[0], row[2]])] + [row[1]] + row[3:] + writer.writerow(new_row)