From: paul Date: Fri, 10 Jun 2016 13:21:24 +0000 (+0000) Subject: generate name field from available information X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=61666ee9e4ce45e915ead39c575493c075c68845;p=lobster generate name field from available information svn path=/trunk/; revision=112 --- diff --git a/actions/generate_courselist.sh b/actions/generate_courselist.sh index b0897c4..6e62a0b 100755 --- a/actions/generate_courselist.sh +++ b/actions/generate_courselist.sh @@ -64,15 +64,22 @@ list_attendee() { #Parameter: Cardfile esac done + n=$(printf %s "$values[N]" + | sed -rn 's:^([^;]*)(;[^;]*)(;[^;]*)?(;[^;]*)?(;[^;]*)?$:4 2 3 1 5:gp' + | sed -r 's:,: :;s:;: :g;s: +: :g;s:^ $::;' + ) + fullname="${n:-${values[FN]:-${values[NICKNAME]}}}" + tel='' for n in TEL TEL{0..10}; do if (echo "$values[$n]" |grep -Eq '[0-9]'); then [ -n "$tel" ] && tel="$tel\\newline $values[$n]" || tel="$values[$n]" fi; done + note='' for n in NOTE NOTE{0..10}; do if [ -n "$values[$n]" ]; then [ -n "$note" ] && note="$note\\newline $values[$n]" || note="$values[$n]" fi; done - echo -E "$values[FN] & $values[BDAY] & $tel & $note" + echo -E "$fullname & $values[BDAY] & $tel & $note" } get_dates() { #Parameter: Calendarfile