SED whitespace removal within a string

Posted by blazeprogrammer on Stack Overflow See other posts from Stack Overflow or by blazeprogrammer
Published on 2010-05-14T20:06:30Z Indexed on 2010/05/15 5:44 UTC
Read the original article Hit count: 170

Filed under:
|
|

I'm trying to use sed to replace whitespace within a string. For example, given the line:

var test = 'Some test text here.';

I want to get:

var test = 'Sometesttexthere.';

I've tried using (\x27 matches the '):

sed 's|\x27\([^x27[:space:]]*\)[[:space:]]|\x27\1|g

but that just gives

var test = 'Sometest text here.';

Any ideas?

© Stack Overflow or respective owner

Related posts about sed

Related posts about whitespace