Article 5EES0 sed command to collapse whitespace

sed command to collapse whitespace

by
__John_L.
from LinuxQuestions.org on (#5EES0)
I'm trying to write a sed command to collapse white space (tab, newlines, spaces, etc.) and whittle consecutive characters down to one space.

I tried:

Code:sed "s/\s+/ /gm" infile.txt >outfile.txtand also:

Code:sed "s/\s{1,}/ /gm" infile.txt >outfile.txtbut both have no effect on whitespace in the input. So much for walking with sed.

Thanks in advance for any help you can provide.latest?d=yIl2AUoC8zA latest?i=_EQ2BQB3Fe8:3p-68Gt1VfM:F7zBnMy latest?i=_EQ2BQB3Fe8:3p-68Gt1VfM:V_sGLiP latest?d=qj6IDK7rITs latest?i=_EQ2BQB3Fe8:3p-68Gt1VfM:gIN9vFw_EQ2BQB3Fe8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments