473,789 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing to an output file using the streamwriter

How do get a line control on the end of a line using the streamwriter.wr iteline (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.WriteL ine(""@@BATCHLO AD 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 6345
If it's a single quote:
outfilew.WriteL ine("'@@BATCHLO AD glrtmt.p'")

If it's a double quote:
outfilew.WriteL ine("""@@BATCHL OAD glrtmt.p""")
"Lyle" <no****@develop mentnow.com> wrote in message
news:a3******** *************** ***********@msn ews.microsoft.c om...
How do get a line control on the end of a line using the
streamwriter.wr iteline (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.WriteL ine(""@@BATCHLO AD 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****@develop mentnow.com> schrieb:
How do get a line control on the end of a line using the
streamwriter.wr iteline (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.WriteL ine(""@@BATCHLO AD glrtmt.p"")


Either encode each double quote character with two consecutive double quote
characters inside the string literal or use 'ControlChars.Q uote' 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.wr ite

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
717
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 streamwriter writing to a network share, is it possible for the network to go down in such a way that the tartet file is only partialy written? or are there some kind of check sums to prevent this.
8
2337
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
2180
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 write the information about user name, filename upload, filesize, date and time of uploading into the log file. (The name of the log file is constructed by Current Year and Current Month in my program). Is there any problems with writing into the...
4
2218
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 because I can view it if I save it from IE. I've tried saving it using the BinaryWriter, TextWriter, and StreamWriter. All have produced the corrupt file. Anyone know what the problem is?
9
2938
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 give me the £ sign - they give me weird characters! I think 156 is the char code for £ ..?!
8
3431
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, Brett
16
2599
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 and more control, and a smaller memory footprint, and I wont need most of their functionality. I do need to handle utf8 and utf16 encodings and I need to insert some tags. Should I use the streamreader/streamwriter classes and the encoding
2
2171
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 streamwriter, it looses the final packet. Strangely, If I output the datapackets to a console from the telnet server, it perfectly gets all the output packets. the code snippet is below: StreamWriter sw = new StreamWriter("c:\\output.txt",...
2
4208
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(); //use millisecond and random to avoid similar filename
0
9665
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
9511
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
10408
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
10139
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
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4092
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
3697
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
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.