Question : find and replace using awk?

Hi, can some one let me know how I can use an awk script to be able to search every line in the file and find the state and zip code and insert a comma(,) between the state and zip fields. My file sample is shown below. Thanks for the  help.
Code Snippet:
1:
2:
3:
4:
john, doe, MO 78985
Mary, decker, TX 89989
Jason ,smith ,789 3r;st, NY 10009
charles, NY 10007
Open in New Window Select All

Answer : find and replace using awk?

awk '{p=match($0,/[A-Z][A-Z] +[0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9]/);print substr($0,1,p+1) "," substr($0,p+2)}' file.txt
Random Solutions  
 
programming4us programming4us