diff --git a/to_zip.sh b/to_zip.sh new file mode 100755 index 0000000..de60ebb --- /dev/null +++ b/to_zip.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -euo pipefail + +FILE="$1" +NAME="$2" +RANGE="$3" +GROUPING="$4" + +poetry run python xlsx_dir_map -i "$FILE" -o "$NAME" -r "$RANGE" "$GROUPING" +zip -r "$NAME.zip" $NAME + diff --git a/xlsx_dir_map/spreadsheet.py b/xlsx_dir_map/spreadsheet.py index c934795..03d9615 100644 --- a/xlsx_dir_map/spreadsheet.py +++ b/xlsx_dir_map/spreadsheet.py @@ -70,9 +70,10 @@ def get_names_list(filename, cellrange, column_groups): for colgroup in column_groups: path = get_value(cells, colgroup) - paths.append(path) - - if "None" not in paths: - names.append("/".join(paths)) + if "None" not in path: + paths.append(path) + + # if "None" not in paths: + names.append("/".join(filter(lambda x: x != '', paths))) return names