#1
|
|||
|
|||
Removing Duplicate Text in a Document
Hi all,
I have the following information in a document. I would like to find a solution/macro to remove the duplicates. Question #1 (ACCCC.101111REG) Question #1 (ACCCC.101111REG) Question #2 (ACCCC.101112.TXT) Question #2 (ACCCC.101112.TXT) Question #3 (ACCCC.101113REG) Question #3 (ACCCC.101113REG) Thanks! |
#2
|
||||
|
||||
Another wildcard Find/Replace job:
Find = (Question #[0-9]@ \(ACCCC*\)^13)\1 Replace = \1
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Hi Macropod,
Not sure if I am the problem (surely I am) but I can't get it to work. Can you check the below code? Thanks, PHP Code:
|
#4
|
||||
|
||||
Your .Text = expression isn't what I posted.
What separates the entries? The Find/Replace expression I posted assumes a single paragraph break.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Hi Macropod,
First, I tried the Find/Replace option as you suggested, but did not work for me. Second, tried to put it in a macro but still does not work for me. Sorry, but I don't know how to get this to work. PHP Code:
|
#6
|
||||
|
||||
Please answer the question I asked in my last post.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Sorry, but I can't answer you question you asked me before, simply because I have no idea, I really don't know.
I thought the problem was the missing parentheses in my code so I went back to the macro I recorded with WORD, add the parenthesis but still don't know where the problem is. There might be some other code within the macro that is wrong, but I don't where.. I feel guilty and stupid by not being able to know or answer this or execute the wildcard Find/Replace job. Of course, and if you don't mine and have the time, would you be able to put this with a simple macro/code with a single paragraph break and another macro or instructions on how to do it with a double paragraph break so I can test it and see what I did wrong? Thank you! Cheers, |
#8
|
||||
|
||||
It's not a matter of me putting anything in a macro, but of what your document contains. Click on the ¶ symbol on the ribbon's Home tab. What to you see between the closing parenthesis in:
Question #1 (ACCCC.101111REG) and the 'Q' in: Question #1 (ACCCC.101111REG) The Find/Replace assumes you'll see: Question #1 (ACCCC.101111REG)¶ Question #1 (ACCCC.101111REG) not: Question #1 (ACCCC.101111REG)¶ ¶ Question #1 (ACCCC.101111REG) or: Question #1 (ACCCC.101111REG) ¶ Question #1 (ACCCC.101111REG) Alternatively, can you attach a document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
I went back to the sample file I was using and noticed the symbol was not the right one. Now, it has the right ¶ symbol.
After doing the corrections, the wildcard function is working. Yes, today I learned something new and as you stated "It's not a matter of me putting anything in a macro, but of what your document contains". Good point... Thank you so much! Regards, rsrasc |
#10
|
||||
|
||||
If your document showed ↵ instead of ¶ at the end of each line, all that would have been required is to change the Find expression's ^13 to ^11.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
Thanks, I did the deadly mistake of copying and pasting the information that I posted in the thread and used it to test the wildcard, and yes indeed, it has the ↵ symbol instead of ¶, that why it didn't work from the beginning.
Question, could you please tell me if it is possible to combine both expression in the same argument? Thanks again! |
#12
|
||||
|
||||
You could use:
Find = (Question #[0-9]@ \(ACCCC*\))[^11^13]\1 Replace = \1
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Locating and removing large, duplicate blocks of copy in word | markaffleck | Word | 2 | 06-05-2014 10:12 PM |
Removing blank pages at the end of a document | Xanzia | Word | 3 | 06-01-2014 11:13 AM |
Finding duplicate sentences in a document | seascape | Word VBA | 1 | 02-18-2014 12:31 AM |
Removing duplicate index entries | Bengt | Word | 5 | 03-01-2013 02:01 AM |
Saving Word document creates a duplicate transparent file | bbailey | Word | 0 | 12-05-2009 10:54 PM |