473,793 Members | 2,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Line Terminators using streamwriter.wr iteline

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.wr iteline 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 10824
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****@develop mentnow.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.w riteline 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.Ne wLine property?

Roman

"Lyle A. Sieren" <no****@develop mentnow.com> ???????/???????? ? ????????
?????????:
news:52******** *************** ***********@msn ews.microsoft.c om...
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.wr iteline 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
23939
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 = "a|b|c|d\n"."e|f|g|h\n"."i|j|k|l\n"."m|n|o|p\n"; I want to use explode() to put the records into an array like this...
11
14897
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, Srinivas
6
3986
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 exceptions? Cheers, Kids
3
15736
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 get any output when writing with StreamWriter, but only with FileStream. I got StreamWriter to work in another class, where I only have 1 Writeline
2
3369
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 the log file. Now what happens is that if i have the folder in which the stream object creates the log file open in windows explorer, i can see that it creates the log file but then it crashes, strnage , can somebody tell me how i can stop this...
2
33969
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 with WriteLine(). How do I insert characters into a string ( ie "line 1\nline 2\n" ) so that when I write them to Stream they will be interpreted properly as newlines? Thanks in advance
3
2895
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
897
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 with new txt content instead of writing on a new line or appending on the existing content? Thanks MM
3
15300
by: tess1243 | last post by:
How to give a line break using CSS? Is this possible?
0
9671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10433
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10161
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2919
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.