Created
May 16, 2020 14:40
-
-
Save dan-dm/cd7fa922c6af0fd360cf54629d3ae6c8 to your computer and use it in GitHub Desktop.
Created with Copy to Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we create a scanner for reading the file | |
try (Scanner scanner = new Scanner(Paths.get("henkilot.csv"))) { | |
// we read all the lines of the file | |
while (scanner.hasNextLine()) { | |
String line = scanner.nextLine(); | |
// if the line is blank we do nothing | |
if (line.isEmpty()) { | |
continue; | |
} | |
// do something with the data | |
} | |
} catch (Exception e) { | |
System.out.println("Error: " + e.getMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment