I want to read text from a file, line by line, and for each line - write it at new file.
:I use the following instruction System.IO.File.AppendAllText(@"C:\Users\David Ben Michael\source\repos\nemerle\files\output.asm",line);
.The problem with this code it that the text attched to the file at a one long line:
: I wish to separate the lines. So Instead of using the instruction above,I used the following code:
if (fileExt == ".vm" )
{def sr = System.IO.StreamReader(fi.FullName);def sw =System.IO.StreamWriter(@"C:\Users\David Ben Michael\source\repos\nemerle\files\output.asm");mutable line = sr.ReadLine ();while (line != null) {sw.WriteLine(line);//System.IO.File.AppendAllText(@"C:\Users\David Ben Michael\source\repos\nemerle\files\output.asm",line);line = sr.ReadLine ();
At this case, the compiler create empty file(!). Why the file is empty? and how I resolved this problem?
Thanks