I'm trying to read doubles from file:
14.23,1.71,2.43,15.6,127,2.8,3.06,.28,2.29,5.64,1.04,3.92,1065,1
13.2,1.78,2.14,11.2,100,2.65,2.76,.26,1.28,4.38,1.05,3.4,1050,1
(...)
Using this method:
List<Double> values = new ArrayList<>();
(...)
value = Double.parseDouble(scanner.next(Pattern.compile("(?!=\\d\\.\\d\\.)([\\d.]+)")));
(...)
values.add(value);
But this doesn't work! I have InputMismatchException, but without message so I completely don't know what is going on. Is pattern wrong or something?
Aucun commentaire:
Enregistrer un commentaire