Indeed you can use external commands within an awk program and share their output, but you don't really need them to achieve your task. In awk there are some useful functions to manipulate string. For example the sub and the gsub functions, act the same as sed. They alter the content of the fields, so that when you print them out, you will see the new value of the string.
Suppose you have the file
Code:
$ cat myfile
#this is a commented line
this is a line of code
#another commented line
You can use the gsub function in the following way:
Code:
$ awk '{gsub(/#/,"",$1); print}' myfile
this is a commented line
this is a line of code
another commented line
the value of the first field has been altered substituting the part of the string matching the regexp /#/, with the replacement string "". The subsequent print command, prints out the line with the altered field. Take a look at the
string manipulation functions on the AWK Programming Guide for more details. Hope this helps.