473,569 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inserting line breaks in text file?

I'm writing something similar to this into a text file:

txtfileError.Wr iteLine(Current DateTime(1) & " Error in Sub Sub1()" & idvar &
Chr(10) & Chr(13) & ex.Message)
txtfileError.Wr iteLine()

Instead of line breaks, I see two boxes. Everything runs together. There
is a double line break where the WriteLine() is. How do I place a single
line break in the text file?

Thanks,
Brett
Nov 21 '05 #1
2 7273
"Brett" <no@spam.net> schrieb:
I'm writing something similar to this into a text file:

txtfileError.Wr iteLine(Current DateTime(1) & " Error in Sub Sub1()" & idvar
& Chr(10) & Chr(13) & ex.Message)
txtfileError.Wr iteLine()

Instead of line breaks, I see two boxes. Everything runs together. There
is a double line break where the WriteLine() is. How do I place a single
line break in the text file?


'WriteLine' will add a single line break. Altneratively you can include
'ControlChars.N ewLine' in the string you write to the file.

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

Nov 21 '05 #2
Chr(10) & Chr(13) should read Chr(13) & Chr(10)

The Carriage Return (13) comes before the Line Feed (10) vbCrLf

Even better use is to use Environment.New Line or break it up into multiple
writes.

txtfileError.Wr iteLine(Current DateTime(1) & " Error in Sub Sub1()" & idvar)
txtfileError.Wr iteLine( ex.Message)
txtfileError.Wr iteLine()

"Brett" <no@spam.net> wrote in message
news:Ok******** ******@TK2MSFTN GP14.phx.gbl...
I'm writing something similar to this into a text file:

txtfileError.Wr iteLine(Current DateTime(1) & " Error in Sub Sub1()" & idvar
& Chr(10) & Chr(13) & ex.Message)
txtfileError.Wr iteLine()

Instead of line breaks, I see two boxes. Everything runs together. There
is a double line break where the WriteLine() is. How do I place a single
line break in the text file?

Thanks,
Brett

Nov 21 '05 #3

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

Similar topics

8
20691
by: lucas | last post by:
I have a text file that i would like to use PHP to read from. each line ends with a \n. i need to read from the beginning of the line, only upto that \n right now i'm using this, which is sloppy and slow: if ($chr = fgetc($file)) != "\n") { } which of course reads in one byte at a time till the end of line. is there a better way? --
1
2499
by: Astra | last post by:
Hi All Could you please let me know how my ASP page can insert 1 row of data containing line breaks into a MySQL DB. To explain, I'm using ASP Classic > MyODBC 3.5x (Win) > MySQL 4 (Win) and my insert command is: INSERT INTO `WEBCONTENT` (CONTENTTEXT) VALUES ('Order Number: Account Number:
5
4028
by: kevin arana | last post by:
Hello. Could anyone please show me an example of how to retrieve a specific line of a text file (say line 3 of data.txt) into a string variable? I have seen many examples on how to dump all the content into a string, and how to read line-by-line consecutively, but how can i read just 1 specific line? Thank you.
20
16618
by: alice | last post by:
I'm doing some text swapping with javascript, got it working fine, but I would like the line to have line breaks and being a beginner, I don't even know if this is possible. So I have a line like this swaptext('Shaun, Greg, Violet, Joel, 1999')"; and I would like 1999 to be on a new line. Is there a simple way to do this? I'd swear I've seen...
4
5546
by: jeepers | last post by:
Hi all, my problem is delete a line in a text file. the file contain -n line with user, userCode. i want to replace the line with user is egual at user, and/or insert new line but delete the line like user. i'm sorry for my english :D if user exist delete a line of the user and insert new line. if not exist insert new line. possibility...
4
4519
by: Johnymap | last post by:
Hi everyone. The text file i am using has the following format: "2001_1.rtf" (1 January 2001) Ookame v Tombale (CCF No. 203 of 2001) BWHC 1 "2001_2.rtf" (1 January 2001) Kgaimena v Leoifo (MISCA F.572 of 2001) BWHC 2 "2002_1.rtf" (7 June 2002) Olebeng v The State (C A No. F104 of 2001) BWHC 1 "2003_1.rtf" (1 January 2003) Sebogodi v...
5
22129
by: Patrick David | last post by:
Hello NG, I am searching for a way to jump to a specific line in a text file, let's say to line no. 9000. Is there any method like file.seek() which leads me to a given line instead of a given byte? Hope for help Patrick
5
2314
by: kashif73 | last post by:
i have a text file which has a fixed length lines. How can I update a particular line (record ) basing on a record ID provided? below is my code which retrieves a particular line from the textfile & display it in xtboxes in my update form.: If System.IO.File.Exists(FILE_NAME) = True Then Dim fs As New FileStream(FILE_NAME, FileMode.Open,...
0
1989
by: rahulsapra | last post by:
hello everyone m new to j2me plzz help I have a text file that contains data line by line.. format is : response:<some text><space>Pin:<some text><space>time:<hh:mm:ss> eg response:invalid pin Pin:1111 time:04:04:16
0
7703
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...
0
7926
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. ...
0
8132
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...
0
7982
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...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3656
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...
1
2116
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
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
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...

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.