I found some problem in your code.
Firstly, this line seems wrong:
if (line.contains("Smokey")){ line = line.replace("Smokey;","AAAAAA;"); bw.write(line+"\n");
it should be:
if (line.contains("Smokey;")){ line = line.replace("Smokey;","AAAAAA;"); bw.write(line+"\r\n");
And you have to clean and close bw after completion.
if (bw != null){ bw.flush(); bw.close(); }
Correct me if I am wrong.
source share