Java: How to read a text file
You can use Files#readAllLines() to get all lines of a text file into a List<String>. for (String line : Files.readAllLines(Paths.get(“/path/to/file.txt”))) { // … } Tutorial: Basic I/O > File I/O > Reading, Writing and Creating text files You can use String#split() to split a String in parts based on a regular expression. for (String part … Read more