473,799 Members | 3,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

line feed and tab

I have a C# app that I am writing which is going to insert text into a
table, which is then picked up by another program and emailed. On the text
version of the email (when the user doesn't have html email), I need to put
tabs in between columns of data and then line feeds after each row. How can
I do this? Right now I'm doing "\t" for tab and "\r\n" for line feed, but
when I generate the text, those characters actually come out in the text.

Please help.
Mark
Nov 13 '05 #1
5 67935
Mark,

Instead of escape sequences you could also use explicit type casting.
To insert a horizontal tab, you would then simply use (char) 9

Hope this helps.

Regards,
Alex

"Mark" <ma*****@kc.rr. com> wrote in message
news:em******** ******@TK2MSFTN GP10.phx.gbl...
I have a C# app that I am writing which is going to insert text into a
table, which is then picked up by another program and emailed. On the text version of the email (when the user doesn't have html email), I need to put tabs in between columns of data and then line feeds after each row. How can I do this? Right now I'm doing "\t" for tab and "\r\n" for line feed, but
when I generate the text, those characters actually come out in the text.

Please help.
Mark

Nov 13 '05 #2
I tried this and it still comes out with the "\t" in the string.

"Alex Bendig" <a.******@ieee. org> wrote in message
news:be******** **@newsserver.r rzn.uni-hannover.de...
Mark,

Instead of escape sequences you could also use explicit type casting.
To insert a horizontal tab, you would then simply use (char) 9

Hope this helps.

Regards,
Alex

"Mark" <ma*****@kc.rr. com> wrote in message
news:em******** ******@TK2MSFTN GP10.phx.gbl...
I have a C# app that I am writing which is going to insert text into a
table, which is then picked up by another program and emailed. On the

text
version of the email (when the user doesn't have html email), I need to

put
tabs in between columns of data and then line feeds after each row. How

can
I do this? Right now I'm doing "\t" for tab and "\r\n" for line feed, but when I generate the text, those characters actually come out in the text.
Please help.
Mark


Nov 13 '05 #3
Could you show some code for the portion where you generate your text
version of the email? One way could certainly be to substitute the verbatim
escape sequences with the appropriate formatting characters.

"Mark" <ma*****@kc.rr. com> wrote in message
news:uT******** ******@tk2msftn gp13.phx.gbl...
I tried this and it still comes out with the "\t" in the string.

"Alex Bendig" <a.******@ieee. org> wrote in message
news:be******** **@newsserver.r rzn.uni-hannover.de...
Mark,

Instead of escape sequences you could also use explicit type casting.
To insert a horizontal tab, you would then simply use (char) 9

Hope this helps.

Regards,
Alex

"Mark" <ma*****@kc.rr. com> wrote in message
news:em******** ******@TK2MSFTN GP10.phx.gbl...
I have a C# app that I am writing which is going to insert text into a
table, which is then picked up by another program and emailed. On the

text
version of the email (when the user doesn't have html email), I need
to
put
tabs in between columns of data and then line feeds after each row.
How can
I do this? Right now I'm doing "\t" for tab and "\r\n" for line feed,

but when I generate the text, those characters actually come out in the text.
Please help.
Mark



Nov 13 '05 #4
Okay, I've tried it both of these ways and get the same result.

string strText="Proper ty Name" + (char)9 + "Address" + (char)9 +
"City/State/Zip";
OR
string strText="Proper ty Name" + "\t" + "Address" + "\t" + "City/State/Zip";

"Alex Bendig" <a.******@ieee. org> wrote in message
news:be******** **@newsserver.r rzn.uni-hannover.de...
Could you show some code for the portion where you generate your text
version of the email? One way could certainly be to substitute the verbatim escape sequences with the appropriate formatting characters.

"Mark" <ma*****@kc.rr. com> wrote in message
news:uT******** ******@tk2msftn gp13.phx.gbl...
I tried this and it still comes out with the "\t" in the string.

"Alex Bendig" <a.******@ieee. org> wrote in message
news:be******** **@newsserver.r rzn.uni-hannover.de...
Mark,

Instead of escape sequences you could also use explicit type casting.
To insert a horizontal tab, you would then simply use (char) 9

Hope this helps.

Regards,
Alex

"Mark" <ma*****@kc.rr. com> wrote in message
news:em******** ******@TK2MSFTN GP10.phx.gbl...
> I have a C# app that I am writing which is going to insert text into a > table, which is then picked up by another program and emailed. On the text
> version of the email (when the user doesn't have html email), I need to put
> tabs in between columns of data and then line feeds after each row. How can
> I do this? Right now I'm doing "\t" for tab and "\r\n" for line
feed, but
> when I generate the text, those characters actually come out in the

text.
>
> Please help.
> Mark
>
>



Nov 13 '05 #5
Mark,

Escape sequences are only interpreted when doing some sort or "Formatted"
operation such as writing to the Console or a file, or in the case of the
StringBuilder, AppendFormat().

To insert formatting characters into a string, try the following:
StringBuilder sb = new StringBuilder() ;

sb.Append("Text ...");

sb.AppendFormat ("\t\t");

sb.Append("More Text");

sb.AppendFormat ("\r\n");

sb.Append("New Line");

Console.WriteLi ne( sb.ToString () );

Dan


"Mark" <ma*****@kc.rr. com> wrote in message
news:em******** ******@TK2MSFTN GP10.phx.gbl...
I have a C# app that I am writing which is going to insert text into a
table, which is then picked up by another program and emailed. On the text version of the email (when the user doesn't have html email), I need to put tabs in between columns of data and then line feeds after each row. How can I do this? Right now I'm doing "\t" for tab and "\r\n" for line feed, but
when I generate the text, those characters actually come out in the text.

Please help.
Mark

Nov 13 '05 #6

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

Similar topics

4
2824
by: Robert | last post by:
Is there some way to suppress the automatic line feed in the detail section of a report in Access? I would like the detail to print out to the right of the existing one. The next line would be jumped to only when the defined group changes. Robert
1
2255
by: Raed Sawalha | last post by:
Is it possible to make the following div to generate automatic line feed when user start writing and reaches the DIV bounderies like in textarea, the case I have when type a continous chars without white space it wont give a new line but when feed a white space it give an automaic new line :- <DIV id=HTMLEditor dir="ltr" contentEditable=true style="BORDER-RIGHT: #1979e1 1px groove; BORDER-TOP: #1979e1 1px groove; VERTICAL-ALIGN: middle;...
5
10833
by: Lyle A. Sieren | last post by:
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.writeline 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...
1
7440
by: Programmer | last post by:
I have this following code: x= tempStr.IndexOf((char)13, 0); The string tempSTR = " Heading"
4
1574
by: Carsten | last post by:
Hello, on my website I'm using the Drupal CMS. But I have a problem. All the output which is generated doesn't start at the first line (when you look at the source). All output starts at the third line. And that's not good for the XML which is generated through the FEED functions from the modules. Because the XML is not valid when the XML-tag doesn't start at the first line. Does anyone know of that? Maybe the htaccess-file ? I don't
6
10397
by: Stick | last post by:
Hi, I am trying to start my email app (in this case Eudora) with a programatically generated email. However, Eudora does not seem to recognize any of the ways I have tried to create line breaks. I have tried "\n", "\r\n", and using the StringBuilder AppendLine() method like this: StringBuilder body = new StringBuilder(1024);
12
1965
by: Seller | last post by:
I am using Wordpress 2.0.6 on Fedora Core 5. An RSS feed is not working for http://survivalofthesickestthebook.com/blog/?feed=rss2 When I use feed validator http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fsurvivalofthesickestthebook.com%2Fblog%2F%3Ffeed%3Drss2 I see a blank space on line one which renders the page unviewable. none of my files have a space at the top, and I have no idea why the page is being served with a space at...
13
2835
by: charliefortune | last post by:
I am fetching some product feeds with PHP like this $merch = substr($key,1); $feed = file_get_contents($_POST); $fp = fopen("./feeds/feed".$merch.".txt","w+"); fwrite ($fp,$feed); fclose ($fp); and then parsing them with PHP's native parsing functions. This is succesful for most of the feeds, but a couple of them claim to be
1
4115
by: Nalaka | last post by:
Hi, We are sending SMS messages using our ASDP.net site (C# code).... How do I add a "Line Feed" character to the string that we are sending? Any help is deeply appreciated Thanks Nalaka
1
10749
by: rengaraj | last post by:
Dear Experts, I am new to XML I want to create an Interview Questions Bank (Intra Net) for our institution. I preferred to store the Question & Answer in xml sheet. But if i vew the xml in internet explorer, the complete contents of each tag displayed as an individual paragraph. I want to insert an line feed character into the tag. Displayed as : <answer>XML stands for EXtensible Markup Language.XML was designed to transport and store...
0
9687
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
9541
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
10251
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
10228
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
10027
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
9072
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.