Unix/Linux Go Back    



How to replace special characters?

UNIX for Advanced & Expert Users




Kindly Note - This is a Single User Post by Forum Member Ravi.K Regarding:
How to replace special characters?.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 04-21-2017   -   Original Discussion by Ravi.K
Ravi.K Ravi.K is offline
Registered User
 
Join Date: Jan 2017
Last Activity: 21 April 2017, 12:20 PM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
How to replace special characters?

Hi Team,

I have data like this.


Code:
|*|.5|*|0.2|*|A.B|*|

Would like to add zero (0) before the decimal point where there is no zero as


Code:
|*|0.5|*|0.2|*|A.B|*|

How to replace |*|. with |*|0.

I tried below command which didn't work


Code:
echo '|*|.5|*|0.2|*|A.B|*' | sed 's/\|\*\|\./\|\*\|0\./g'

Thanks...

Last edited by Corona688; 04-21-2017 at 03:47 PM..