From cc761b6765fc851cbebee8d07d050627a8acc60a Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Mon, 20 Dec 2021 12:15:26 +0100 Subject: [PATCH] creating a changelog from excel with -c flag now adds spaces to the formulas for better pasting in word --- work_helpers/excel2changelog.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/work_helpers/excel2changelog.py b/work_helpers/excel2changelog.py index ffe27f2..92fc86b 100644 --- a/work_helpers/excel2changelog.py +++ b/work_helpers/excel2changelog.py @@ -13,6 +13,12 @@ sheet = "Input_Data_*" col_start = "A" row_start = 8 +def xls_formula_spacing(formula): + for c in "();=": + formula = formula.replace(c, f"{c} ") + return formula + + def text_to_changelog( raw_text, sheet, start_column, start_row, compact=False, keep=False @@ -35,6 +41,8 @@ def text_to_changelog( cell = cell.strip() if not (cell or keep): continue + if compact: + cell = xls_formula_spacing(cell) output.append(f"{sheet}{xls_sep}{column}{row}\t{cell}") iterator = iter(output)