Reading a File¶
Write a program that reads and parses files like this
(download
):
1910420003;Corinna;Baumgartner
1910420002;Anzhelika;Chernykh
1910420005;Simon;Hu
1910420006;Matthias;Kappel
1810420009;Peter;Kolter
1920420033;Jan;Kornberger
1910420007;Luis;Kraker
1810420010;Leonid;Kudriaschov
1910420008;Michael;Lang
1910420010;Sonja;Lukas
1910420013;Behnaz;Mehrabadi
1910420014;Leo;Moser
1910420015;Moritz;Nagelschmied
1910420018;Bianca;Reimer
1910420020;Tim;Schmid
1910420021;Lukas;Schüttler
1910420022;Michael;Schweiger
1910420024;Paul;Sinabell
1910420025;Jan;Slovik
1910420026;Daniel;Söls
1910420027;Michael;Stangl
1910420028;Felix;Themessl
1920420035;Astrid;Vogel
1810420029;Florian;Zwittnigg
666;Jörg;Faschingbauer
The program parses each line as a student record, consisting of
Matriculation number
First name
Last name
Commandline¶
The program is invoked with the student database file name as its only parameter,
$ path/to/repo/root/exercises/lastname.firstname/studentdb students.txt
Output¶
The program writes to standard output one line per student record,
Note
Please take care that the output is exactly as shown (spaces are spaces, not tabs, for example). This greatly helps a future checker script.
$ path/to/repo/root/exercises/lastname.firstname/studentdb students.txt
...
MatNr: 1810420029, Last name: Zwittnigg, First name: Florian
MatNr: 666, Last name: Faschingbauer, First name: Jörg
$