so the data string开发者_Go百科 would become..." />
开发者

insert a space after a specific character with awk?

How do I insert a space after a specific character with awk?

The test data

<>jhjashdhasdkh

I want to insert a space " " after > so the data string开发者_Go百科 would become...

The modifyed test data now becomes...

<> jhjashdhasdkh

Does anyone know how to do that with awk. ? I've tried everything I can..

Thank you for helping,


You'll want to read about the sub and gsub functions in the gawk manual


In my case, I had to insert a decimal point after a number.
NewBid = substr(spotBidRate,1,1) "." substr(spotBidRate, 2)

The sample input: spotBidRate=367305000
The Sample output: NewBid=3.67305000

So in your case, it would be a space,
NewBid = substr(spotBidRate,1,1) " " substr(spotBidRate, 2)

Hope that helps!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜