extract_wiki_comments.awk 243 B

123456789101112131415
  1. {
  2. if ($1 == "/*" && ($2 == "==" || $2 == "===" || $2 == "===="))
  3. {
  4. print "\n"substr($0,4);
  5. in_comment = 1;
  6. }
  7. else if ($1 == "*/" && in_comment == 1)
  8. {
  9. print "";
  10. in_comment = 0;
  11. }
  12. else if (in_comment)
  13. print;
  14. }