Advertisement
Guest User

Untitled

a guest
May 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1.         int ileSkopiowano = 0;
  2.         try (Scanner odczyt = new Scanner(new File(sciezkaPlikuJeden)); PrintWriter pw = new PrintWriter(sciezkaPlikuDwa)) {
  3.             while (odczyt.hasNextLine()) {
  4.                 String odczytanaLinijka = odczyt.nextLine();
  5.                 if (odczytanaLinijka.contains("Kognitywistyka")) {
  6.                     pw.write(odczytanaLinijka);
  7.                     pw.write(System.lineSeparator());
  8.                     ileSkopiowano++;
  9.                 }
  10.             }
  11.         }
  12.         catch (IOException ex) {
  13.         }
  14.         System.out.println(ileSkopiowano);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement