Browse Source

creating a changelog from excel with -c flag now adds spaces to the formulas for better pasting in word

master
Holger Frey 3 years ago
parent
commit
cc761b6765
  1. 8
      work_helpers/excel2changelog.py

8
work_helpers/excel2changelog.py

@ -13,6 +13,12 @@ sheet = "Input_Data_*"
col_start = "A" col_start = "A"
row_start = 8 row_start = 8
def xls_formula_spacing(formula):
for c in "();=":
formula = formula.replace(c, f"{c} ")
return formula
def text_to_changelog( def text_to_changelog(
raw_text, sheet, start_column, start_row, compact=False, keep=False raw_text, sheet, start_column, start_row, compact=False, keep=False
@ -35,6 +41,8 @@ def text_to_changelog(
cell = cell.strip() cell = cell.strip()
if not (cell or keep): if not (cell or keep):
continue continue
if compact:
cell = xls_formula_spacing(cell)
output.append(f"{sheet}{xls_sep}{column}{row}\t{cell}") output.append(f"{sheet}{xls_sep}{column}{row}\t{cell}")
iterator = iter(output) iterator = iter(output)

Loading…
Cancel
Save