RE: remove spaces from Word

Subject: RE: remove spaces from Word
From: "Combs, Richard" <richard -dot- combs -at- Polycom -dot- com>
To: sphilip <philstokes03 -at- googlemail -dot- com>, "techwr-l -at- lists -dot- techwr-l -dot- com (techwr-l -at- lists -dot- techwr-l -dot- com)" <techwr-l -at- lists -dot- techwr-l -dot- com>
Date: Thu, 21 Mar 2013 09:06:08 -0700

sphilip wrote:

> Richard Combs wrote:
> > Just remember to run it multiple times in case there are instances of three,
> four, or more spaces. Run it until Words tells you the Find string wasn't
> found.
> In fact, this is what occasioned the question. In sed I can do all that in one
> command, with something like
> sed s/' \{2,9\}/ '/g

But as Keith and Laura pointed out, replacing all multiple spaces in one swell foop can wreak havoc if spaces are used for formatting, as in code examples. So you'd want to be _certain_ there's no formatting with spaces in the file.

> which will take out anything from 2 up to 9 spaces (9 is arbitrary - I just
> figure I'm not going to find more than that, but I could make that final
> number anything up t o 255).

IMHO, if there are more than three or four spaces in a row, it's almost certain that spaces are being used for formatting.

> What I was wondering was which was the least work : convert all the word files
> into plain text, run them through sed, put them back into Word OR could I do
> it all in Word with an already existing macro?

Your Word docs must have very little formatting if you're even _considering_ round-tripping through plain text! I'd guess that running a Replace All manually even four or five times takes less time than reapplying styles to a couple of pages of the typical document.

If you have lots of docs to do (and you're sure they don't use spaces for formatting), creating a macro would be worthwhile. The Find/Replace operation is a pretty simple procedure, and you should be able to create the macro in minutes by recording it.

Richard G. Combs
Senior Technical Writer
Polycom, Inc.
richardDOTcombs AT polycomDOTcom
rgcombs AT gmailDOTcom

EPUB Webinar: Join STC Vice President Nicky Bleiel as she discusses tips for creating EPUB, the file format used for e-readers, tablets, smartphones, and more.

Learn more:


You are currently subscribed to TECHWR-L as archive -at- web -dot- techwr-l -dot- com -dot-

To unsubscribe send a blank email to
techwr-l-leave -at- lists -dot- techwr-l -dot- com

Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit for more resources and info.

Looking for articles on Technical Communications? Head over to our online magazine at

Looking for the archived Techwr-l email discussions? Search our public email archives @

remove spaces from Word: From: phil stokes
Re: remove spaces from Word: From: yehoshua paul
RE: remove spaces from Word: From: Combs, Richard
Re: remove spaces from Word: From: sphilip

Previous by Author: Good grammar victory in England
Next by Author: RE: Need a word
Previous by Thread: Re: remove spaces from Word
Next by Thread: Re: remove spaces from Word

What this post helpful? Share it with friends and colleagues:

Sponsored Ads