awk text that is on several lines
Hi,
I am using awk to show the comments in a file like this ....
this is a /* comment on */ one line and
this is /* also on one */ line.
#find the lines which start with "/* and end with "*/"
#remove the "/*" and "*/" from output
awk -F[\/][\*] '{print $2}' | awk -F[\*][\/] '{print $1}' file.txt
This works fine if the comment is on one line but what if the person is long winded and the comments go for several lines like this .....
this is a /* comment which
takes up several lines
in the file. */
How do you get awk or sed to continue on down past the \n ?
|