]> git.plutz.net Git - confetti/blobdiff - actions/generate_courselist.sh
fix another typo. OK, it is really about a broken c+p function m-)
[confetti] / actions / generate_courselist.sh
index b0897c4fdee3d6072fe2369d13ab69730d1c5202..97589ee6f7b96ccd6761799e33ea671ab95b326d 100755 (executable)
@@ -64,15 +64,22 @@ list_attendee() {  #Parameter: Cardfile
     esac
   done
 
     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
   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
   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
 }
 
 get_dates() {  #Parameter: Calendarfile