开发者

sed + remove spaces between different char with "," seperator between them

开发者 https://www.devze.com 2023-01-03 13:03 出处:网络
param can be one of the following a,b 开发者_高级运维,f,d or a, b, c,e or r , q,c , d but we want a,b,c,d without spaces

param can be one of the following

a,b 开发者_高级运维 , f, d

or

a, b , c, e

or

r , q ,c , d

but we want a,b,c,d without spaces

for example if we get: a , b ,c,d need to change it to a,b,c,d sytax to do that yael

what the best sed syntax to change it


Something like

s/ *, */,/g

I haven't tested it so you may need to fiddle a bit.


Try:

tr -d ' ' < inputfile

or

sed 's/ //g' inputfile
0

精彩评论

暂无评论...
验证码 换一张
取 消