Change the line feed code of a certain file? Program for.
The original file is CRLF, but I wanted it to be LF only. The character code is UTF-8 for both input and output.
OS:Windows8.1 Pro Java Version: jre1.8
See this article for file input / output.
//At the end of the record\Grant LF.
while ( ( msg = br.readLine()) != null ) {
bf.append(msg);
bf.append("\n");
}
\ n
to \ r \ n
.Recommended Posts