I have a file "list" as following:
main.c getname 25
main.c getage 36
util.c namecheck 123
The above has first string file name, second function name, and third line no. I want to:
- Open the file(1st column)
- Go to line no (3rd column)
- Edit the string (2nd column).
Ex: Open the file main.c, change the string getname to getname() in line no 25
Does anyone know how to do the above using sed and awk?
I tried to use the following. But it doesn't work
awk '{ sed -e "$3s/$2/&()" <$1 >$1_new }' list