我想用来sed
从文本文件中删除所有评论。假设注释从“A”字符开始,到换行符结束。我想删除从“A”开始到行尾的所有内容,包括换行符。但是,我不想删除从“AA”开始的评论。
样本输入:
%% comment to do not delete
% comment to delete
% another comment to delte
%% comment to do not delete
Some text % comment to delete
and some more text %% comment to do not delete
期望的输出:
%% comment to do not delete
%% comment to do not delete
Some text and some more text %% comment to do not delete