I am getting correct output but still not passing! And as hint I am getting this : Be sure that your solution uses FileWriter.
Am I missing something ?
package com.codegym.task.task19.task1923;
/*
Words with numbers
*/
import java.io.*;
import java.util.regex.Pattern;
public class Solution {
public static void main(String[] args) throws IOException {
FileReader fileReader = new FileReader(args[0]);
BufferedReader reader = new BufferedReader(fileReader);
FileWriter fileWriter = new FileWriter(args[1], true);
String check = "\\D+";
while (reader.ready()) {
String data = reader.readLine();
String[] arr = data.split(" ");
for (int i =0; i < arr.length; i++) {
String word = arr[i];
if (!word.matches(check)) {
fileWriter.write(word + " ");
}
}
}
reader.close();
fileWriter.close();
}
}