I'm using the following code to extract and reformat data from an
input file.
Input: Some Interesting Data abc xyz
awk '/Some Interesting Data/{print $1,$2,$3","$4","$5}' input.txt >
output.txt
Resulting output: Some Interesting Data,abc,xyz
What I'd like to do is to reformat the search string /Some Data/ when
it is found in the input file and print that reformatted data to the
output file. When the input string /Some Data/ is found, it is
reformatted to My New Data
The result would be:
My New Data,abc,xyz
Basically, I want to do a "search and replace".
How do I do that in AWK?
Thanks
--
Luis
(remove * to reply by mail)