I have opened a PDF file in Word in order to edit it (the original Word document is lost). During the conversion, each line of text and each table cell was given an extra space. Of course, they don't really hurt anyone except me and my slight OCD. I don't like trailing whitespace.
It's trivial to remove a trailing space at the end of a line (search for " ^p"
and replace with "^p"
), but there doesn't seem to be a special character for "end of table cell marker" in the find/replace dialog, and the Word "regex" engine doesn't appear to support anchors either.
A Google search brought me to this tip on how to add something to the end of a table cell (I planned to add something like "§§§"
to each cell and then do a simple search/replace for " §§§"
), but in Word 2016, I can't find the Style "Table cell", at least not in the German version of Word.
Any other idea I could try? Also, any idea how to remove one or more spaces at the end of a line/table cell? Quantifiers don't seem to work in a non-regex find/replace.
TRIM
, then copy back, keeping the formatting from original version in Word." (?=\t|$)"
with nothing). Unfortunately, pasting the text back into the table fails because of combined cells, footnotes, formatted text and tabs within cells. Those weren't visible in my screenshot, but they are present in the tables I need to fix. So I guess I'll be looking into a VBA solution (shudder).