How to write to a file using awk to find a string in between ( ); and add a printline after ; to print the string found?
I have some files in a folder that has several sqrt(x+y); functions. I want to find out what is in x+y. So I want to read the value inside sqrt(x+y ); and add a printf(x+y ); after the semicolon. I was trying this for about a month. But still cannot find a way. Please help. If you know where I can find any good tutorial or book about AWK please let me know.. Thanks. Following is the algorithm that I figured. (I am totally new to AWK) loop thro all files{ if one line starts with sqrt( start put the strings in to variable a /or array a until find ); write Print ( , concatenate, then the value ,