wcsjas
asked on
Format Lines in an .rtf document after specified tags
Someone sent me a .txt file with information that they ultimately want to be placed in a FileMaker database, but I have to do some work on it before it gets there. I copied the text in to a Word file and saved it as an .rtf file. What I am needing to do is have the lines after the tags be changed to a bold format and the tags removed. Below is a sample of the data given to me (with names and addresses changed for privacy). There are over 74,000 words in the document so I need some way to automate the task.
Here is how I would like it to look.
How would I go about changing the selected lines to a Bold format?
@T=Echo Hill, Ryanville, Any State
@I=Location: 6 miles north of Ryanville on Hwy Z72 at the Hwy A71 intersection
@S=Leader
John Henry, Box 1234, Ryanville, ZZ 12345
@S=Echo Hill School
Box 9999, Andyville, ZZ
@S=Board Members
Harvey Junior
Gavin Sarupta
Sergio Gonzalves
Here is how I would like it to look.
Echo Hill, Ryanville, Any State
Location: 6 miles north of Ryanville on Hwy Z72 at the Hwy A71 intersection
Leader
John Henry, Box 1234, Ryanville, ZZ 12345
Echo Hill School
Box 9999, Andyville, ZZ
Board Members
Harvey Junior
Gavin Sarupta
Sergio Gonzalves
How would I go about changing the selected lines to a Bold format?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the quick reply!
\@[A-Z]{1}=(*^13)
\ is the escape character in this context, so \@ means 'look for the @ character, and do not use its special meaning in Word search'
[A-Z] means any upper-case letter
{1} means one only of the previous list in the square brackets
= as is
( start of the first replacement string
* any number of any character until the next searched-for character
^13 paragraph mark. Note that in the replace string and in all non-wildcard find or replace strings, ^p will do the same job.
) end of the first replacement string
For the replacement code, \1 means, replace with the string found within the first round-bracketed text in the Find
Here is an excellent reference link;
http://word.mvps.org/FAQs/General/UsingWildcards.htm
\ is the escape character in this context, so \@ means 'look for the @ character, and do not use its special meaning in Word search'
[A-Z] means any upper-case letter
{1} means one only of the previous list in the square brackets
= as is
( start of the first replacement string
* any number of any character until the next searched-for character
^13 paragraph mark. Note that in the replace string and in all non-wildcard find or replace strings, ^p will do the same job.
) end of the first replacement string
For the replacement code, \1 means, replace with the string found within the first round-bracketed text in the Find
Here is an excellent reference link;
http://word.mvps.org/FAQs/General/UsingWildcards.htm
Graham - you knowledge of (what I consider) obscure uses of Word functions always impresses me!
Paul
Paul
ASKER
Wow! Thanks again. Learn a little every day!
Thanks Paul,
I'm still crap with pictures :)
wcsjas,
It is a pleasure to help anyone who wants to learn
I'm still crap with pictures :)
wcsjas,
It is a pleasure to help anyone who wants to learn
ASKER