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 04-21-2017
Ravi.K Ravi.K is offline
Registered User
 
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 02:47 PM..