Advertisement
krokodyl101

Untitled

Mar 26th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public List<String[]> parse () throws FileNotFoundException {
  2.         String filePath = "C:/java_workspace/ttt/src/main/webapp/csv/xPc.csv";
  3.         List<String[]> data = new ArrayList<>();
  4.  
  5.         try (Stream<String> streamData = Files.lines(Paths.get(filePath))){
  6.             data = streamData
  7.                     .map(line -> {
  8.                         String[] str = line.split(":");
  9.                         return str;
  10.                         })
  11.             .collect(Collectors.toList());
  12.         } catch (IOException ioe) {
  13.             ioe.printStackTrace();
  14.         }
  15.         return data;
  16.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement