1838703 Members
3857 Online
110128 Solutions
New Discussion

Re: sed and spaces

 
SOLVED
Go to solution
Fred Martin_1
Valued Contributor

sed and spaces

I need to remove all occurances of side-by-side spaces in a text file...for example I want this:

WORDWORD

to become this:

WORDWORD

man pages on sed say that this will do it:

sed 'y///'

But I can't get that to work.

sed 's///g'

The above won't work because it only removes non-overlapping occurances.

Help,
Fred
fmartin@applicatorssales.com
2 REPLIES 2
Sundar_7
Honored Contributor
Solution

Re: sed and spaces

Try this

sed 's/ */ /g'
Learn What to do ,How to do and more importantly When to do ?
Fred Martin_1
Valued Contributor

Re: sed and spaces

That's it. To be clear (because this forum format seems to remove spaces too) here it is again:

sed 's/*//g'

Many thanks,
Fred
fmartin@applicatorssales.com