with sed:
###UPDATE
sed -e '/\/\*/ {
/\*\// {d
s/\/\*.*\*\///g;
b next
};
:loop;
/\*\//! {N;b
N;
b loop
};
/\*\// {d
s/\/\*.*\*\//\n/g
}
:next
}'
EXAMPLE:
FILENAME:support all possible (multi line comment, data after [or and] befor, );
/*This is to print the outpute1/*comment*/
NEWLINE-------------------
NEWLINEe1/*comment*/e2
-------------------
NEWLINE/*comment*/e2
data*-------------------
e1/*com
proc print data=sashelp.cars;ment*/
run;-------------------
e1/*Creating dataset**com
ment*/e2
data abc;-------------------
set xyz;/*com
run;ment*/e2
-------------------
e1/*com
1
2
ment*/
-------------------
e1/*com
1
2
ment*/e2
-------------------
/*com
1
2
ment*/e2
-------------------
and out put####run:
$ sed -e '/\/\*/{/\*\//{d};:loop;/\*\//!{N;bf loop};/\*\//{d}}'command.sed FILENAME
proc print data=sashelp.cars;
run;e1
data abc;-------------------
set xyz;e1e2
run;-------------------
e2
-------------------
e1
-------------------
e1
e2
-------------------
e2
-------------------
e1
-------------------
e1
e2
-------------------
e2
-------------------