Advertisement
s_m4rt

Untitled

Nov 25th, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. static void otworzPlik() throws IOException{
  2.  
  3. String of = "glupiabaza.txt";
  4. String str = " ";
  5. final Pattern SPACE = Pattern.compile("\\s+");
  6. String[] splited = SPACE.split(str); // str is the string to be split
  7. int nrlinii = 0;
  8. Dane tmp = new Dane();
  9. final Pattern pattern = Pattern.compile("\\s");
  10. try (BufferedReader bufReader = new BufferedReader(new FileReader(new File(of)))) {
  11.  
  12. while ( ( str = bufReader.readLine() ) != null )
  13.  
  14. nrlinii++;
  15. System.out.println(str);
  16. //for(int i=0;i<100;i++){
  17. // for(int j=0; j<100;j++){
  18. //String id=splited[0];
  19. tmp.imie=splited[1];
  20. tmp.nazwisko=splited[2];
  21. tmp.wiek=Integer.parseInt(splited[3]);
  22. tmp.miasto=splited[4];
  23. tmp.stankonta=Double.parseDouble(splited[5]);
  24. //}
  25.  
  26.  
  27. // }
  28. } catch (IOException e) {
  29.  
  30. e.printStackTrace();
  31.  
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement