title: Filtering debug output for C#
body: <p>Is it possible to filter out different sorts of exceptions out of my debug output in C#?</p>
  
  <p>I want to filter out 'System.FormatException', because I know it's going to occur, and it gives a rubbish oversight of my output. I'm scanning a textfile with over 20,000 lines, and almost a quarter of them are wrong, but I don't want 'System.FormatException' 5000 times in my output...</p>
  
  <p>The code is seen below, and you can see, if it's not a number, it will not double.parse, so it will catch the error.</p>
  
  <pre><code>if (!(dataline.EndsWith(";0") || intCounter == 0))
  {
      try
      {
          natMB = double.Parse(splitline[8], NumberStyles.AllowDecimalPoint, NumberFormatInfo.InvariantInfo);
      }
      catch
      {
          natMB = 0;
      }
  
      double intMB;
      try
      {
          intMB = double.Parse(splitline[9], NumberStyles.AllowDecimalPoint, NumberFormatInfo.InvariantInfo);
      }
      catch
      {
          intMB = 0;
  </code></pre>