When I use \r\n
in Windows, to print a newline in a file, it works if the file is <anyfile>.v
, i.e., it's extension is .v
. But if the file extension is changed to .ucf
, it starts printing some garbage. I do it through Java code. Any help?
.v
is a verilog file and .ucf
is a Xilinx propietory constraints file. Both are handled by Xilinx software.
On running,
import java.io.*;
public class ucf {
public static void main(String[] args) throws IOException {
FileWriter output = new FileWriter("sample.ucf");
output.write("foo\r\n\bar\r\n");
output.close();
}
}
garbage is produced.