|
using awk to comment out lines to the end of file
Hello,
I have a file as follow
a
b
c
c
d
d
e
I would like to write a awk command to insert # from the first occurence of
"c" to the end of the files.
OUTPUT should be like this
a
b
#c
#c
#d
#d
#e
I kept getting error while attempting to use break
awk ' if ( $1 ~ /^c/ ) { beginline = NR ; break } '
Greatly appreciate your comment
|