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

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 67911
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**************@TK2MSFTNGP10.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.rrzn.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**************@TK2MSFTNGP10.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**************@tk2msftngp13.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.rrzn.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**************@TK2MSFTNGP10.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="Property Name" + (char)9 + "Address" + (char)9 +
"City/State/Zip";
OR
string strText="Property Name" + "\t" + "Address" + "\t" + "City/State/Zip";

"Alex Bendig" <a.******@ieee.org> wrote in message
news:be**********@newsserver.rrzn.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**************@tk2msftngp13.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.rrzn.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**************@TK2MSFTNGP10.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.WriteLine( sb.ToString () );

Dan


"Mark" <ma*****@kc.rr.com> wrote in message
news:em**************@TK2MSFTNGP10.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
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...
1
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...
5
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...
1
by: Programmer | last post by:
I have this following code: x= tempStr.IndexOf((char)13, 0); The string tempSTR = " Heading"
4
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...
6
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...
12
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...
13
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...
1
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
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
0
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,...
0
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...

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.