SORT CARD for replacing characters.

Hi all,

Am new to linux.
Please advise me how to program a SORT CARD that relaces characters.
For e.g.,

201115456563040gh879245k
20112450911804Ads559672p
20112276533504{tg090669d
201123776591040ra008792y
20114452611704{wq47544q

In the above data, I need to relace all { to 0 (am talking about the bold part).

Kindly advise me a sort card for the above.

$ sed 's,{,0,g' infile

---------- Post updated at 04:10 PM ---------- Previous update was at 04:05 PM ----------

in nawk ..

$ nawk '{sub(/{/,"0")};1' infile
1 Like

Do you want to replace all the '{' characters with '0', or replace the 3 bold character columns with something else? (or give some example output)

I want to replace only the { to 0. Like..

20112276533504{tg090669d

the o/p generated for the above would be
201122765335040tg090669d

I have bolded the three letters because the three characters are on my notice. It may be the below case also...

201122765335{40tg090669d or
2011227653350{0tg090669d or
20112276533504{tg090669d.

But my output will replace the { to 0.