473,388 Members | 1,340 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,388 software developers and data experts.

Line Terminators using streamwriter.writeline

I posted this earlier with another question but did not explain myself well... How do get a line feed character on the end of a line using the streamwriter.writeline fuction? Following are a list of possible terminators. I need to use the line feed, option 2, instead of the others for the application that will be reading the file.

LineTerminator ::=
1. < Unicode carriage return character (0x000D) > |
2. < Unicode line feed character (0x000A) > |
3. < Unicode carriage return character > < Unicode line feed character > |
4. < Unicode line separator character (0x2028) > |
5. < Unicode paragraph separator character (0x2029) >

From http://www.developmentnow.com/g/38_2...nguages-vb.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 21 '05 #1
5 10757
Lyle,

I thought that I answered that to you, why do you open a new thread instead
of asking for some more clarification if you don't understand my answer.

Cor
Nov 21 '05 #2
"Lyle A. Sieren" <no****@developmentnow.com> schrieb:
I posted this earlier with another question but did not explain myself
well... How do get a line feed character on the end of a line using the
streamwriter.writeline fuction? Following are a list of possible
terminators. I need to use the line feed, option 2, instead of the others
for the application that will be reading the file.
[...]
2. < Unicode line feed character (0x000A) > |


Instead of calling 'WriteLine', call 'Write' and add the line separators
yourself:

\\\
sw.Write(Line & ControlChars.Lf)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
Hi,

Have you tried to set StreamWriter.NewLine property?

Roman

"Lyle A. Sieren" <no****@developmentnow.com> ???????/???????? ? ????????
?????????:
news:52**********************************@msnews.m icrosoft.com...
I posted this earlier with another question but did not explain myself well... How do get a line feed character on the end of a line using the
streamwriter.writeline fuction? Following are a list of possible
terminators. I need to use the line feed, option 2, instead of the
others for the application that will be reading the file.
LineTerminator ::=
1. < Unicode carriage return character (0x000D) > |
2. < Unicode line feed character (0x000A) > |
3. < Unicode carriage return character > < Unicode line feed character > | 4. < Unicode line separator character (0x2028) > |
5. < Unicode paragraph separator character (0x2029) >

From http://www.developmentnow.com/g/38_2...nguages-vb.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

Nov 21 '05 #4
Errata:

As Dragon says, the 'StreamReader''s 'NewLine' property is the way to go...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #5
Sorry Cor! I opened a new thread before you had posted the reply. And btw I shouted Thanks on the other because I truly appreciate any help I can get!

Thanks to everyone who has replied to my questions!

From http://www.developmentnow.com/g/38_2...-writeline.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 21 '05 #6

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

Similar topics

6
by: William Krick | last post by:
I have a string containing concatenated ascii "records" that are each terminated by '\n'. For testing purposes, I construct sample data like this... $mystring =...
11
by: srinivas | last post by:
Hi all, I have one requirement.Is there any way to create a line graph using javascript.If it is please send me the sample code.But the thing is it should work in all browsers. Thanks,...
6
by: kids_pro | last post by:
Hi there, using(StreamWriter wr = new StreamWriter(filename,false,Encoding.UTF8,1024)){} Will the line above throw any exception when it can't create file? What is the best way to capture it...
3
by: Mads Westen | last post by:
Hi, I'm making some changes to my program, because I need to write with Codepage 850. Before I used FileStream, but I found code to use with StreamWriter instead. My problem is, that I don't...
2
by: sameer | last post by:
Hi, My very simple application VB.NET Visual Studio 2003 console application uses a log file to write some text to it. I am using StreamWriter object to create and open and then append text to...
2
by: Fred Dag | last post by:
Hi, When writing using both these methods ( StreamWriter.Write("\n") vs WriteLine() ) to a file and open in Notepad I see a special character instead of newlines with Write("\n") vs a newline...
3
by: ptek | last post by:
Hi, For example, if I do : using System.IO; using (StreamWriter sw = new StreamWriter("text.txt")) { sw.WriteLine("coupé");
0
by: mm3178 | last post by:
Hello, I have a windows service application and I want to log the whole process inside it. I am currently using streamwriter to log into a txt file. How do we log everytime on a same line...
3
by: tess1243 | last post by:
How to give a line break using CSS? Is this possible?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.