Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void otworzPlik() throws IOException{
- String of = "glupiabaza.txt";
- String str = " ";
- final Pattern SPACE = Pattern.compile("\\s+");
- String[] splited = SPACE.split(str); // str is the string to be split
- int nrlinii = 0;
- Dane tmp = new Dane();
- final Pattern pattern = Pattern.compile("\\s");
- try (BufferedReader bufReader = new BufferedReader(new FileReader(new File(of)))) {
- while ( ( str = bufReader.readLine() ) != null )
- nrlinii++;
- System.out.println(str);
- //for(int i=0;i<100;i++){
- // for(int j=0; j<100;j++){
- //String id=splited[0];
- tmp.imie=splited[1];
- tmp.nazwisko=splited[2];
- tmp.wiek=Integer.parseInt(splited[3]);
- tmp.miasto=splited[4];
- tmp.stankonta=Double.parseDouble(splited[5]);
- //}
- // }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement