X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/04fed8e4657d28df3ca947ea34c2a5d8f9ccc02f..61d7dd11d4a450a64f2817ee4db0ec7fa5880b42:/bin/work/anwesenheit_klausur?ds=sidebyside diff --git a/bin/work/anwesenheit_klausur b/bin/work/anwesenheit_klausur new file mode 100755 index 0000000..0fd7f2b --- /dev/null +++ b/bin/work/anwesenheit_klausur @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +use strict; + +open(CSV_FILE, ">data.csv"); + +my $header_done; + +print CSV_FILE "Name,Vorname,Matrikel,Wid.,prf\n"; + +while (<*.xls>) { + my $fileName = $_; + my @file = `xls2csv $fileName 2>&1` ; + + my $cnt = 0; + while (<@file>) { + $cnt++; + if ($cnt < 4) { next; } + if ( m/HISsheet/ ) { next; } + + my @data = split(",", $_); +# print "@data"; + my @orderedData = @data[2,1,0,4]; + push(@orderedData, substr($fileName,0, -4)); +# print "@orderedData"; +# print CSV_FILE "$_," . substr($fileName,0, -4) . "\n"; + print CSV_FILE join(",", @orderedData) . "\n"; + } +} + +close(CSV_FILE);