StreamWriter and CR/LF

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
 
J

Jon Skeet [C# MVP]

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.
 
R

Rich

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top