Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- // System.out.println(liczbaWystapien("ala ma kota", "a"));
- File file = new File("student.txt");
- try {
- FileOutputStream fout = new FileOutputStream("student3.txt");
- DataOutputStream out = new DataOutputStream(fout);
- Scanner sc = new Scanner(file);
- while(sc.hasNext()){
- String[] student = sc.next().split(";");
- if(Integer.parseInt(student[2]) >= 3){
- out.writeUTF(student[0]);
- out.writeUTF(student[1]);
- out.writeUTF(student[2]);
- }
- }
- out.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment