Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ileSkopiowano = 0;
- try (Scanner odczyt = new Scanner(new File(sciezkaPlikuJeden)); PrintWriter pw = new PrintWriter(sciezkaPlikuDwa)) {
- while (odczyt.hasNextLine()) {
- String odczytanaLinijka = odczyt.nextLine();
- if (odczytanaLinijka.contains("Kognitywistyka")) {
- pw.write(odczytanaLinijka);
- pw.write(System.lineSeparator());
- ileSkopiowano++;
- }
- }
- }
- catch (IOException ex) {
- }
- System.out.println(ileSkopiowano);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement