473,386 Members | 1,828 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.

split RTF formatting code help me urgently

how can I split these rtf formatting code from string in C#?
string exampleString ="
. Point we hall invetigate in thi direction include:par par pntextpardplainfc1 aiaf0af20 fc0 f3f20lang2057langfe1033langnp2057 lochaf3dbchaf0hichf3 'b7tabpard qj fi-360li360ri0l360lmult1widctlpar*pn pnlvlbltilvl0l1pnrnot0pnf3pntart1pnindent360pnhang pntxtb 'b7faautol1rin0lin360itap0pararid6227368 fc1 aiaf0 fc0 iinrid6227368 Automation of the earch and filtering proce through the ue of intelligent agentfc1 af0 fc0 inrid6227368 . Autonomou media-pecific agent can be ued to execute the actual earch and collaboratively filter the reult."

help me urgently
Mar 21 '07 #1
4 2353
sani723
117 100+
You need to read and understand the rtf format, IIRC it's a markup format,
if so you will need to parse the file. a RegEx may help you, but I think that you may need something different, like a parser ( a la LEX ).

The Rich Text Format (RTF) Version 1.5 Specification is freely

http://www.biblioscape.com/rtf15_spec.htm#Heading3
Mar 21 '07 #2
sani723
117 100+
or directly read from RTF File

System.IO.StreamReader FReader =
new System.IO.StreamReader((System.Reflection.Assembly .GetExecutingAssembly().
GetManifestResourceStream("LearnAndEarn.Credits.rt f")));
string str = FReader.ReadToEnd();
FReader.Close();
DedicationRichTextBox.Text = str;
DedicationRichTextBox.Visible = true;
Mar 21 '07 #3
sani723
117 100+
this can surely help you, you can access directly the .rtf file and then format the output.

http://www.codeproject.com/useritems...ntaxColour.asp
Mar 21 '07 #4
Thanks for helping me but I can't solve my prob above these.
In my project,I open RTF file with StreamReader.
use sr.ReadLine() and assign to string variable.
At that time,I got RTF formatted string ,not the right text.
that is my coding.
StreamReader sr = new StreamReader(Example.rtf,Encoding.Default);
string strWord = null;
while ((strWord = sr.ReadLine()) != null)
{
// do something;
}
I want to replace or split if the readline string text is RTF formatting code.
Otherwise I will take the string to do something.I wll read end of the RTF file.

thanks alot you guys.
help me please.
Mar 21 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Jonathan | last post by:
Hi, I have to use the nl2br function in the asp file, luckly I got this code from a site. What I need done is to display textbox content the way it was typed/pasted i.e. with paragraph breaks and...
1
by: TJ | last post by:
I am very new to C# (this is my first real project), therefore please be patient if my question is considered being to newbie. I am modifying a program which takes a text file, does some...
7
by: byoxemeek | last post by:
I have an array created from an undelimited text file I receive with a format like: 60190012003010203040506070809101112 60190012004010203040506070809101112 6019001200501020304...
1
by: ree321 | last post by:
When there is a long image in the HTML it is being split over two pages in the Print Preview rather than moving the image down to the next page. Is there a way to get around this so the image will...
1
by: surrayya | last post by:
AOA: Is there any one to help me.i am in great trouble.i want to read a file in c++ program that is consisting of data in 2cols and 70 rows. Tokens freq abcd 50 dssd ...
4
by: Joonshik Kim | last post by:
I was trying to define 3d array with pointer to pointer. I wrote like following. int ***d; nx = 3; ny = 5; nz = 4; d = (int ***)malloc((int) nx*sizeof(int **)); *d = (int **)malloc((int)...
11
by: Brian | last post by:
I have been working on a data reception system.. I am still finding my way around Javascript, though I am accomplishing much. I just fixed a flaw that was really hard to find. The symptoms are...
2
by: cpraveen10 | last post by:
Hi All... I am using MSComm to receive data serially in a text box. The data being recieved is 1A2B3C1A2B3C1A2B3C...........so on... I have read this into a text file. So I am now getting...
1
by: ajc308 | last post by:
I have a text file that I am reading in, and on some of the lines, there are multiple numbers that need to be read into seperate variables. The problem I am having, is that sometimes, the numbers...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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
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.