From fb30c96d53c0da5ef0c40bf44341d1f9a6ebec0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Fri, 5 Feb 2021 02:50:05 +0100 Subject: [PATCH] omit empty teltype when exporting csv --- cards/export_csv.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cards/export_csv.sh b/cards/export_csv.sh index a1004f7..6f17d1f 100755 --- a/cards/export_csv.sh +++ b/cards/export_csv.sh @@ -26,7 +26,12 @@ list_item() { seq 1 $cnt |while read n; do case $item in TEL) tel="$(pdi_value "$card" "$item" "$n" |unescape)" - [ "$tel" ] && printf '%s: %s\n' "$(l10n "TYPE=$(pdi_attrib "$card" "$item" "$n" TYPE)")" "$tel" + ttype="$(pdi_attrib "$card" "$item" "$n" TYPE)" + if [ "$tel" -a "$ttype" ]; then + printf '%s: %s\n' "$(l10n "TYPE=$ttype")" "$tel" + elif [ "$tel" -a "$ttype" ]; then + printf '%s\n' "$tel" + fi ;; GENDER) gen="$(pdi_value "$card" "$item" "$n" |unescape)" -- 2.39.2