mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-28 04:31:56 +01:00
17 lines
566 B
Java
17 lines
566 B
Java
public void readFromCSVFile(String filename) throws FileNotFoundException {
|
|
Scanner scanner = new Scanner(new File(filename));
|
|
scanner.nextLine(); // skip header line
|
|
while (scanner.hasNext()) {
|
|
String line = scanner.nextLine();
|
|
String[] parts = line.split(",");
|
|
String lastname = parts[0];
|
|
String firstname = parts[1];
|
|
int yearOfBirth = Integer.parseInt(parts[2]);
|
|
String pw = parts[3];
|
|
System.out.println(lastname + "/" + firstname + "/" + yearOfBirth + "/" + pw);
|
|
|
|
// Your stuff coming here
|
|
..........
|
|
}
|
|
scanner.close()
|
|
} |