Solved

Tool to modify existing text

Posted on 2003-12-11
2
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

632 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