Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Tool to modify existing text

Posted on 2003-12-11
2
Medium Priority
?
231 Views
Last Modified: 2010-04-16
I want to create an RTF file from scratch.  Is there a tool that comes with C# that allows me to do widespread inserts at the beginning of the line.

I want to convert the raw RTF codes from this:


{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f35\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
{\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana;}{\f39\froman\fcharset0\fprq2{\*\panose 02020404030301010803}Garamond;}{\f40\froman\fcharset0\fprq2{\*\panose 02040602050305030304}Book Antiqua;}
{\f41\froman\fcharset238\fprq2 Times New Roman CE;}{\f42\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f44\froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\froman\fcharset162\fprq2 Times New Roman Tur;}


to this:


fileTxt.WriteLine("{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f35\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}")
fileTxt.WriteLine("{\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Verdana;}{\f39\froman\fcharset0\fprq2{\*\panose 02020404030301010803}Garamond;}{\f40\froman\fcharset0\fprq2{\*\panose 02040602050305030304}Book Antiqua;}")
fileTxt.WriteLine("{\f41\froman\fcharset238\fprq2 Times New Roman CE;}{\f42\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f44\froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\froman\fcharset162\fprq2 Times New Roman Tur;}")



I want to create some sort of automation or macro action that will insert


fileTxt.WriteLine("


at the beginning of the line, and


")  


at the end of the line.
0
Comment
Question by:Tom Knowlton
2 Comments
 
LVL 5

Accepted Solution

by:
Tom Knowlton earned 0 total points
ID: 9922006
STOP:

I found the answer:

Under Tools, Macro, Record Temporary Macro in the C# IDE.
0
 

Expert Comment

by:YensidMod
ID: 9923005
Question is PAQed and 500 points refunded.

YensidMod
Experts Exchange Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Integration Management Part 2

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question