Solved

Tool to modify existing text

Posted on 2003-12-11
2
226 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:knowlton
2 Comments
 
LVL 5

Accepted Solution

by:
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 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