The requirement is i need to find an array value matching with pattern {5:{ , replace that with 5: and reassign that to same array index and print it.
I write something like below and the issue is sed command is not working. If i replace " with "`" the script gives syntax error.how can i achieve this?
With what you have shown us, we have to do a lot of guessing to try to figure out what might be going wrong. Please, whenever you start a thread, tell us what operating system and shell you're using. And, when showing us a fragment of an awk script with associated diagnostic messages, indicate which line of the code you have shown us is the one that the diagnostic refers to (in this case, which line is line #180).
First, use /usr/xpg4/bin/awk or nawk ; not awk when you're using any Solaris/SunOS system. (I strongly recommend /usr/xpg4/bin/awk since it meets all of the POSIX standard's requirements.)
Second, while sed uses Basic Regular Expressions (BREs), awk uses Extended Regular Expressions (EREs). And, in EREs, the opening brace character ( { ) is special and needs to be escaped when you are looking for a literal opening brace character. The code rdrtx1 suggested may work on some systems, but is not portable and (according to the standards) produces undefined behavior.
Third, since you are looking for a single occurrence of the string {5:{ , there is no need to use gsub() (which looks for and attempts to find and replace as many occurrences of a matching pattern as it can find).
Note that I also moved the i++ into the for statement instead of hiding the loop increment in your print statements and I moved the print statement out of both branches of the if statement so it is more obvious that the same print is needed whether or not a match is found.