title: Use sed to removing inline comments
body: <p>I would like to use <code>sed</code> to remove all comments from a text file. Let's say that comment starts from 'A' character and end at the new line character. I would like to remove everything starting from the 'A' to the end of line including new line character. However, I don't want to remove comments starting from "AA".</p>
  
  <p>Sample input:</p>
  
  <pre><code>%% 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
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>%% comment to do not delete
  %% comment to do not delete
  Some text and some more text %% comment to do not delete
  </code></pre>