Q:

After writing into a file with java the file isn't usable for further processing

I write with a java program into a file for further processing. This is the code for writing into the file:
FileOutputStream fos;
File f = new File(outputFilePath);
fos = new FileOutputStream(f);

final String R = "\r";

try {
    fos.write((outputString + R).getBytes());
    fos.flush();
    fos.close();
} catch (IOException e) {
    logger.error("fail..."+ e);
}

This works fine and after process I check with notepad++ the file and the right lines are in it. But if I want to use it with a perlscript (obj2opengl.pl) there comes an error. If I copy exactly that text into a new textfile manually with notepad++ it works. So my assumption is that there is somesthing wrong or bad in my java code. I tried already other encodings and so on... maybe anyone have an idea. 
The error of the perl script says: "Illegal division by zero at obj2opengl.pl line 294".
That error not occured if I test it with the same text after copied it in a new textfile.

A:

Try to change 
final String R = "\r";

to
final String R = "\n";

