где ошибка? String s; while ((s = fileIn.readLine()) != null) { s.replaceAll("\\.", "!"); fileOut.write(s); fileOut.newLine(); }