title: StreamWriter ordering using Foreach
body: <p>I have some text that contains numerous values like so:</p>
  
  <pre><code>PartNumber    Description    Amount
  Fid1          blahblahblah   999934109
  0603          moreblah       12
  exclude       ehh?           981
  FID5          fillertext     123
  fid2          fillertext     123
  fid           fillertext     123
  0603          fillertext     123
  0603          fillertext     123
  0603          fillertext     123
  0402          fillertext     123
  0402          fillertext     123
  //etc.........etc............etc
  </code></pre>
  
  <p>I would like to print out the values that contain <strong>"FID"</strong></p>
  
  <pre><code>int j = 1;
  foreach (var line in theList)
  {
      if (line.PartNumber.ToUppeR().Contains("FID"))
      {
          sw.WriteLine("{0}: {1} {2} {3}", 
                         j,
                         line.PartNumber,
                         line.Amount,
                         line.Description);
          j++;
      }
  }
  </code></pre>
  
  <p>However, when I do this, it prints them out as follows:</p>
  
  <pre><code>1: Fid1 999934109 blahblahblah
  2: FID5 123 fillertext
  3: fid2 123 fillertext
  4: fid 123 fillertext
  </code></pre>
  
  <p>and I would like to print them out numerically.. so like this:</p>
  
  <pre><code>1: fid 123 fillertext
  2: Fid1 999934109 blahblahblah
  3: fid2 123 fillertext
  4: FID5 123 fillertext
  </code></pre>
  
  <p>Is there an easy, quicky way to do this?</p>