sed - How to replace a character in a pattern in unix -


i have search string in particular position , if string contains {, has replaced 0.

for example:

text='i have 45320{ dollar' 

in above example, { needs replaced 0 , @ same corresponding number needs converted 2 decimal places.

expected output:

 text='i have 4532.00 dollar' 

is possible implement logic in unix using sed?

using sed, can do:

$ text='i have 45320{ dollar' $ sed 's/\(.\){/.\10/' <<< "$text" have 4532.00 dollar 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -