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

Writing to an output file using the streamwriter

How do get a line control on the end of a line using the streamwriter.writeline (not carriage line control)?

How do you get the following command to print a quote in the file? I have tried using double quotes as shown below but this is not working.

outfilew.WriteLine(""@@BATCHLOAD glrtmt.p"")

THANKS!

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 6323
If it's a single quote:
outfilew.WriteLine("'@@BATCHLOAD glrtmt.p'")

If it's a double quote:
outfilew.WriteLine("""@@BATCHLOAD glrtmt.p""")
"Lyle" <no****@developmentnow.com> wrote in message
news:a3**********************************@msnews.m icrosoft.com...
How do get a line control on the end of a line using the
streamwriter.writeline (not carriage line control)?

How do you get the following command to print a quote in the file? I
have tried using double quotes as shown below but this is not working.

outfilew.WriteLine(""@@BATCHLOAD glrtmt.p"")

THANKS!

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

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

Nov 21 '05 #2
"Lyle" <no****@developmentnow.com> schrieb:
How do get a line control on the end of a line using the
streamwriter.writeline (not carriage line control)?
What's a "line control"?
How do you get the following command to print a quote in the file? I
have tried using double quotes as shown below but this is not working.

outfilew.WriteLine(""@@BATCHLOAD glrtmt.p"")


Either encode each double quote character with two consecutive double quote
characters inside the string literal or use 'ControlChars.Quote' to
represent a quotation mark.

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

Nov 21 '05 #3
Lyle,

There are a lot of methods to get those it is a LF linefeed or a CR carriage
return Chrw(10) or a Chrw(13)

http://msdn.microsoft.com/library/de...es_chart_1.asp

If you want to use them, than do not use writeline however create the file
in mem and write it with streamwriter.write

I hope this helps,

Cor
Nov 21 '05 #4
By line control I mean the line terminator. Following is a list of different line terminators. I would like to use the second one, the line feed character.

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) >

THANKS!!!


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

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 21 '05 #5
Lyle,
1. < Unicode carriage return character (0x000D) > |
2. < Unicode line feed character (0x000A) > |


This is the CHRW(10) as I showed you, what is your problem that you are
shouting THANKS.

Cor
Nov 21 '05 #6

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

Similar topics

1
by: Daniel | last post by:
System.IO.StreamWriter Close or Flush method to shut down the computer in such a way that just part of the file is written? or an empty file is written? Also if the Close or Flush is to a...
8
by: AMeador | last post by:
I can see console output in the output window on VS, but how can you see this text when running the app on a different machine or outside of VS? Thanks! --- Andrew
4
by: HNguyen | last post by:
Hi, I have a Web application in ASP.NET. My Application allows the users upload files into the server after checking their user names and passwords. For each transaction, the Web program will...
4
by: Greg | last post by:
Using the HttpWebRequest I'm downloading a PDF file and am trying to save it to the hard drive, but it keeps ending up corrupt (according to adobe acrobat). I know the PDF file isn't corrupt...
9
by: musosdev | last post by:
I'm having trouble writing £ (pound sign) to a file from my asp.net app. I've tried.. StreamWriter.WriteLine("£") - and - StreamWriter.WriteLine(Convert.ToChar(156).ToString()) but neither...
8
by: Brett Romero | last post by:
I'd like to use Debug.Assert() but output to a log file instead of the popup window. Can some one provide an example of how that is done? Or will C# only let you use th popup window? Thanks,...
16
by: billsahiker | last post by:
I am researching for an upcoming c# .net 2.0 project that may require reading and writing xml files. I don't want to use xmltextreader/ xmltextwriter as I prefer to have lower level file access...
2
by: =?Utf-8?B?S3VtYXI=?= | last post by:
I am using granados telnet client for connecting to the telnet and get the data from it. Every thing appears to be going smooth. But for some reason when I try to write the byte data to a string or...
2
by: as001 | last post by:
Hi, I'm writing a windows application in C# using VS 2003. I got stuck where it has to write multiple output text files. Here's my piece of code: for loop { Random r = new Random();...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.