Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Search and Replace help.
Hello Folks
I have a document with many thousands of lines. All lines are 12 or so words each with a "-" somewhere in the middle. I want to be able to swap the words around to the other side of the "-". The lenght and the amount of the words can vary. e.g. if I have:- apple banana - pear orange plum wood metal glass - plastic I want the result to be:- pear orange plum - apple banana plastic - wood metal glass This must work on selected text only as only 3/4 of the document needs changing, not the whole lot. Mr Graham Mayor gave me following but it is not quite working. It is only swapping around the words either side of the " - " A wildcard replace of ([a-zA-Z]@)( - )([a-zA-Z]@) with \3\2\1 on the selected text should work. So please can Graham or someone else help me out a bit further. Your help is and always has been very much appreciated. Thanking you in anticipation. -- Big Rick |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Search and Replace help.
I know what I would do but it's not going to be the way the Wordies would do
it. I'd dump those lines int Excel, swap them around, then put them back into Word. -- JoAnn Paules MVP Microsoft [Publisher] ~~~~~ How to ask a question http://support.microsoft.com/KB/555375 "Big Rick" wrote in message ... Hello Folks I have a document with many thousands of lines. All lines are 12 or so words each with a "-" somewhere in the middle. I want to be able to swap the words around to the other side of the "-". The lenght and the amount of the words can vary. e.g. if I have:- apple banana - pear orange plum wood metal glass - plastic I want the result to be:- pear orange plum - apple banana plastic - wood metal glass This must work on selected text only as only 3/4 of the document needs changing, not the whole lot. Mr Graham Mayor gave me following but it is not quite working. It is only swapping around the words either side of the " - " A wildcard replace of ([a-zA-Z]@)( - )([a-zA-Z]@) with \3\2\1 on the selected text should work. So please can Graham or someone else help me out a bit further. Your help is and always has been very much appreciated. Thanking you in anticipation. -- Big Rick |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Search and Replace help.
Assuming each line ends a paragraph, replace
([a-zA-Z ]@)( - )([a-zA-Z ]@)^13 with \3\2\1^p instead -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Big Rick wrote: Hello Folks I have a document with many thousands of lines. All lines are 12 or so words each with a "-" somewhere in the middle. I want to be able to swap the words around to the other side of the "-". The lenght and the amount of the words can vary. e.g. if I have:- apple banana - pear orange plum wood metal glass - plastic I want the result to be:- pear orange plum - apple banana plastic - wood metal glass This must work on selected text only as only 3/4 of the document needs changing, not the whole lot. Mr Graham Mayor gave me following but it is not quite working. It is only swapping around the words either side of the " - " A wildcard replace of ([a-zA-Z]@)( - )([a-zA-Z]@) with \3\2\1 on the selected text should work. So please can Graham or someone else help me out a bit further. Your help is and always has been very much appreciated. Thanking you in anticipation. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Search and Replace help.
Absolutely, superb.
Thank you very much. -- Big Rick "Graham Mayor" wrote: Assuming each line ends a paragraph, replace ([a-zA-Z ]@)( - )([a-zA-Z ]@)^13 with \3\2\1^p instead -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Big Rick wrote: Hello Folks I have a document with many thousands of lines. All lines are 12 or so words each with a "-" somewhere in the middle. I want to be able to swap the words around to the other side of the "-". The lenght and the amount of the words can vary. e.g. if I have:- apple banana - pear orange plum wood metal glass - plastic I want the result to be:- pear orange plum - apple banana plastic - wood metal glass This must work on selected text only as only 3/4 of the document needs changing, not the whole lot. Mr Graham Mayor gave me following but it is not quite working. It is only swapping around the words either side of the " - " A wildcard replace of ([a-zA-Z]@)( - )([a-zA-Z]@) with \3\2\1 on the selected text should work. So please can Graham or someone else help me out a bit further. Your help is and always has been very much appreciated. Thanking you in anticipation. |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Search and Replace help.
Absolutely superb. Thank you very much.
Your webite was a great help in tweaking it to include other characters. -- Big Rick "Graham Mayor" wrote: Assuming each line ends a paragraph, replace ([a-zA-Z ]@)( - )([a-zA-Z ]@)^13 with \3\2\1^p instead -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Big Rick wrote: Hello Folks I have a document with many thousands of lines. All lines are 12 or so words each with a "-" somewhere in the middle. I want to be able to swap the words around to the other side of the "-". The lenght and the amount of the words can vary. e.g. if I have:- apple banana - pear orange plum wood metal glass - plastic I want the result to be:- pear orange plum - apple banana plastic - wood metal glass This must work on selected text only as only 3/4 of the document needs changing, not the whole lot. Mr Graham Mayor gave me following but it is not quite working. It is only swapping around the words either side of the " - " A wildcard replace of ([a-zA-Z]@)( - )([a-zA-Z]@) with \3\2\1 on the selected text should work. So please can Graham or someone else help me out a bit further. Your help is and always has been very much appreciated. Thanking you in anticipation. |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Search and Replace help.
You are welcome
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Big Rick wrote: Absolutely superb. Thank you very much. Your webite was a great help in tweaking it to include other characters. Assuming each line ends a paragraph, replace ([a-zA-Z ]@)( - )([a-zA-Z ]@)^13 with \3\2\1^p instead -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Big Rick wrote: Hello Folks I have a document with many thousands of lines. All lines are 12 or so words each with a "-" somewhere in the middle. I want to be able to swap the words around to the other side of the "-". The lenght and the amount of the words can vary. e.g. if I have:- apple banana - pear orange plum wood metal glass - plastic I want the result to be:- pear orange plum - apple banana plastic - wood metal glass This must work on selected text only as only 3/4 of the document needs changing, not the whole lot. Mr Graham Mayor gave me following but it is not quite working. It is only swapping around the words either side of the " - " A wildcard replace of ([a-zA-Z]@)( - )([a-zA-Z]@) with \3\2\1 on the selected text should work. So please can Graham or someone else help me out a bit further. Your help is and always has been very much appreciated. Thanking you in anticipation. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
search and replace 1) and 2)...12) | Formatting Long Documents | |||
Need some Search & Replace help | New Users | |||
Search & Replace | Microsoft Word Help | |||
Search and Replace | Microsoft Word Help | |||
search and replace | Microsoft Word Help |