I have a directory called Files and it has many files.I want to read these Files line by line and store them an
List<List<String>> .
./Files
../1.txt
../2.txt
../3.txt
..
..
it goes like that.
private List<List<String>> records = new ArrayList<>();
List<Path> filesInFolder = Files.list(Paths.get("input"))
.filter(Files::isRegularFile)
.collect(Collectors.toList());
records = Files.lines(Paths.get("input/1.txt"))
.map(row -> Arrays.asList(row.split(space)))
.collect(Collectors.toList());