Syntax for awk
awk <options> 'Program' Input-File1 Input-File2 ... awk -f PROGRAM-FILE <options> Input-File1 Input-File2 ...
If no Input-File is specified then `awk’ applies the Program to “standard input”, (piped output of some other command or the terminal. Typed input will continue until end-of-file (typing `Control-d’)
Example for search and replace
awk ‘{ gsub( /search_string/ , replacestring , $0 ); print }’ file
If you want to write the output to a file, then simple redirect the output as shown below:
awk ‘{ gsub( /search_string/ , replacestring , $0 ); print > output_file }’ file
Hope, it helps!










So where's the replace portion of the post? I don't see any sub()s or the like …
Find and replace text and there is no REPLACE. Bravó!