StreamWriter and CR/LF

  • Thread starter Thread starter Rich
  • Start date Start date
R

Rich

Ok I am writing lines out to a text file for an interface
to another system. The other system need to have a CR/LF
at the end of each line. What is the code for this. I
have tried vbCrLf and StreamWriter.NewLine = ("\r\n")
which seems like it puts a carriege return in but when I
open the file in edit from DOS I do not see the char.
Can someone please point me in the correct direction.
Thanks.


Rich
 
Rich said:
Ok I am writing lines out to a text file for an interface
to another system. The other system need to have a CR/LF
at the end of each line. What is the code for this. I
have tried vbCrLf and StreamWriter.NewLine = ("\r\n")
which seems like it puts a carriege return in but when I
open the file in edit from DOS I do not see the char.
Can someone please point me in the correct direction.
Thanks.

You could write the "\r\n" directly to the stream, but I shouldn't
think that's actually necessary. Could you write a short but complete
program which demonstrates the problem? See
http://www.pobox.com/~skeet/csharp/complete.html for what I mean.
 
It looks like my code was correct. For some reason the
system I was interfaceing with yester would not work, but
today everything works fine. Go figure. Thanks for your
help though.

Rich
 
Back
Top