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
Post a Comment