473,395 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

StreamWriter and CR/LF


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
Nov 22 '05 #1
2 8693
Rich <rk*@companyabc.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 22 '05 #2
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

-----Original Message-----
Rich <rk*@companyabc.com> wrote:
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'tthink that's actually necessary. Could you write a short but completeprogram which demonstrates the problem? See
http://www.pobox.com/~skeet/csharp/complete.html for what I mean.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: | last post by:
Hi, When constructing StreamWriter with the following.. FileStream f = new FileStream(..); StreamWriter s = new StreamWriter(f); Then attempt to write out åäö letters they become garbage. ...
1
by: Vladimir Bezugliy | last post by:
I have a server that listen a socket. And I have next client: TcpClient socketForServer = new TcpClient("IVBEZUGLIY", 21000); NetworkStream networkStream = socketForServer.GetStream();...
4
by: Majed | last post by:
Hi , all I'm trying to write unicode to a file for another app (not developed with vs2003) to read it. I used StreamWriter with unicode encoding.but I was surprised that the streamwriter adds FFFE...
1
by: Daniel | last post by:
i would like to konw when the data sent so that i can close the streamwriter and networkstream is there some sort of call backs/events i have to implement for this to work? if so how? can i just...
1
by: Lars Hansen | last post by:
Hi This is probably pretty basic, but I have a problem with the access-level (local variable), when creating a new StreamWriter. I am trying to write some price information to a textfile - which...
9
by: ShadowOfTheBeast | last post by:
Hi, I have got a major headache understanding streamReader and streamWriter relationship. I know how to use the streamreader and streamwriter independently. but how do you write out using the...
4
by: rex64 | last post by:
I am getting an error message and I have not been able to figure hot how to fix it. I have done some research with no answers yet. I found this code that may help? Not sure what to do with it....
10
by: Oscar Thornell | last post by:
Hi, I generate and temporary saves a text file to disk. Later I upload this file to Microsoft MapPoint (not so important). The file needs to be in UTF-8 encoding and I explicitly use the...
1
by: Max Powers | last post by:
Hello, I have a VB.NET code that creates a StreamWriter file first and then it does a series of procedures that write lines for this StreamWriter. When all the procedures are done, the...
4
by: Heron | last post by:
Hi, Could someone explain me why the following code doesn't work? The memorystream always remains with length 0. MemoryStream input = new MemoryStream();
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.