Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<String[]> parse () throws FileNotFoundException {
- String filePath = "C:/java_workspace/ttt/src/main/webapp/csv/xPc.csv";
- List<String[]> data = new ArrayList<>();
- try (Stream<String> streamData = Files.lines(Paths.get(filePath))){
- data = streamData
- .map(line -> {
- String[] str = line.split(":");
- return str;
- })
- .collect(Collectors.toList());
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- return data;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement