View Single Post
  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default delete sections of text using find and replace

If the entries are all in the same format. Use the method described at
http://www.gmayor.com/convert_labels...mail_merge.htm to convert them to
a table then either use mail merge to a directory format to extract the bits
you want, or delete the unwanted columns and convert the table back to text.
If the entries are not all the same, then you can use replace to remove the
unwanted similar bits - see
http://www.gmayor.com/replace_using_wildcards.htm .

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Bonni wrote:
Hi Doug,
Thanks for the tips. What you say is exactly correct. Basically what
i have is a word document with a list of contacts. From that all i
need is the name and country and email address. Each entry is
identically ordered (name, country, mailing address, other
address,tel, fax, email, web page, category, CSO notes). basically
what i want to do is delete everything from 'Mailing address' to
'email' and replace it with a ',' with no spaces before or after the
comma. i will then be able to save this as *.csv and import it into
Outlook as a contact base (after applying the same process to what
appears after the email address).

I hope this is more informative.

"Doug Robbins - Word MVP" wrote:

How similar are the entries? and where did the email address come
from? and is this really what you want:

AACC - Association Algérienne de Lutte Contre la Corruption


with no space between the , and the start of the email address.

If you give full information, you will have a much better chance of
getting a useful response.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Bonni" wrote in message
...
Hi,
Its a little more complex than that. here is an actual example:

? AACC - Association Algérienne de Lutte Contre la Corruption
(Algeria) Mailing address: Centre Familial de Ben Aknoun Alger 16
Algeria
Other address: Tel.: Fax: E-mail: Web page:
http://www.transparency.org/ Category: 6. CSO Notes:

would need to become:

AACC - Association Algérienne de Lutte Contre la Corruption



any ideas? i know that i would need to do it twice to remove
whatever is before the mail address and that which comes after the
address.

thanks.

"Poprivet" wrote:

Bonni wrote:
Hi,
I need to delete certain sections of text in a word doc. and
replace it with ','
for example:
the cat sat on the mat
would need to become:
the,mat
i have 4000 lines of this and do not want to have to manually
delete all the uneccessary text.

Any pointers?

CTRL-H will bring up the Replace dialog box. PUt what you have in
the top
line, what you wnat it to be inthe second box, try a couple of
replaces and
if it works toyour liking, hit Replace All.