473,804 Members | 4,181 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 10836
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
23941
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
14898
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
3990
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
15739
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
3372
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
33977
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
2897
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
899
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
15302
by: tess1243 | last post by:
How to give a line break using CSS? Is this possible?
0
9706
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
9579
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
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
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,...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
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
3
2990
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.