Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Jun 18, 2021 6:10 PM
Views: 47
Tags: io
  1. public Set<EvaluationRecord> readcsv(){
  2.         var result = new HashSet<EvaluationRecord>();
  3.         try{
  4.             Path p = Paths.get("evaluation.csv");
  5.             // Neuer Pfad, dann alle Zeilen lesen von path
  6.             var lines = Files.readAllLines(p);
  7.  
  8.             for(var line : lines){
  9.                 result.add(new EvaluationRecord(line));
  10.             }
  11.         } catch (IOException e){
  12.             System.out.println("Pfad doest not exist");
  13.             e.printStackTrace();
  14.         }
  15.         return result;
  16.     }
  17. }