Hi friends , I want to ignore single and multiline comment( enclosed by " \* *\" ) of a file whle reading it. I am using the below code.
nawk '/\/\*/{f=1} /\*\//{f=0;next} !f' proc.txt | while read str
do
...
done
The problem is its working partially. that is its failing in one case.(shown below) i.e whenever there is a comment follwing a non comment in the same line, its deleting the whole line.
for example:
select col1 , col2
from /* selecting columns from the table1 */
table1;
if we run the above script on the above code it will remove 2nd line totally.
OUPUT:
select col1 , col2
table1;
but the output should be :
select col1 , col2
from
table1;
please help. thanks in advance