#1
|
|||
|
|||
A Widlcard or Macro to Properly Remove Spaces Between Commas?
I have a fairly large document with lots of quotes in inverted commas. When I try to remove them using search and replace it removes the spaces, but one side or the other then ends up connected to the preceding or following word.
So if I use find and replace to fix this sentence Luke adds the words " To repentance." It will bring the "To together but also the word following repententance." Is there such a way that I can properly fix this without doing it line by line? Thanks. |
#2
|
||||
|
||||
If you're using smart quotes (i.e. “ & ”), you can search for one or the other, instead of using " - which finds both. Of course, if your document has the wrong smart quotes in some locations, those will still have to be processed manually. Alternatively, you might use a Find/Replace with:
Find = ^w"^w Replace = ^32" Instead of ^32 you could insert a space. This will find only those double-quotes that have white space before and after - thus leaving repentance." alone.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
I have found when searching for smart quotes that it would change both sides anyway. Was that just me?
Will a variation of that find and replace option work if I just use ^w" or "^w? |
#4
|
||||
|
||||
The ^w tells Word to find any white-space character (e.g. ordinary space, non-breaking space, tab). Using just ^w" will Find all double-quotes preceded by white-space and "^w will Find all double-quotes followed by white-space. What I understand you need to find is double-quotes that have white-space on both sides, hence the ^w"^w.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Thanks.
These are old works that have been OCR'ed. So many of the quotes have inverted commas on the left with a space between the word, but the last one does not. Like this: " The quick brown fox jumps over the lazy dog" Sometimes the space appears on the other side: "The quick brown fox jumps over the lazy dog " And sometimes on both sides: " The quick brown fox jumps over the lazy dog " What would be the set up to fix all three of these issues using Find and Replace? Thanks again. |
#6
|
||||
|
||||
You can't automatically fix all those combinations via Find/Replace. You would need to do a Find/Replace with, say:
Find = "^w Replace = " and stepping though each one, replacing on a case-by-case basis, following by a Find/Replace with: Find = ^w" Replace = " and stepping though each of those, replacing on a case-by-case basis. There is simply no way Word can tell whether a given quote mark is misplaced. Yes, a Find/Replace expression could be crafted to look for certain patterns, but that would be thrown off immediately there was a mismatch - I've seen far too many OCR'd documents where quotes have been misinterpreted as some other character to assume they'd all be OK.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Hi,
Yes, that's what I meant. I wouldn't have imagined that Word could replace them all with one command. And your're right, OCR, especially when dealing with older documents, can't be trusted to convert a document correctly. But the program I have doesn't do a job, and knowing how to automatically remove as many discrepancies as possible before I go over it with the human eye still removes a huge amount of manual labor. Thanks again for your help. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can I remove spaces between only Chinese characters? | sivartnosredna7 | Word | 2 | 01-09-2017 05:33 AM |
How to remove spaces from Cells which are at the end of value? | LearnerExcel | Excel | 2 | 12-19-2016 01:10 PM |
Macro does not run properly | dherr | Word VBA | 2 | 02-19-2015 08:50 AM |
remove repeated words with " macro " or " wild cards " in texts with parentheses and commas | jocke321 | Word VBA | 2 | 12-10-2014 11:27 AM |
editing text and remove spaces | romanticbiro | Word VBA | 5 | 07-04-2014 07:42 PM |