title: c# sorting a textfile
body: <p>I have a question about how to sort a text file.
  I have a <code>srec</code> file and I need to sort it before I send it over <code>COM1</code>.
  So during opening or before sending I need to sort the file. </p>
  
  <p>Here's a example of my <code>srec</code> file:</p>
  
  <blockquote>
    <p>S2140338BE0E0606510004008D15FE915115FE9191CC
    S2140338CE04008D15FE9006010242C78C0AB79C04AF
    S2140338DE008D15FE91D6C78C0AB79C04088D1D0065
    S2130338EE1A16270704088D1D001A0CC78C11190C<br>
    S20C038E880000000000000D23AA<br>
    S2100202C000033403000336C3000338DBDF
    S2140347C0045C3F0510060504008D15FEFC1304006B
    S2140347D08D15FEFD060104008D15FE80068304007C
    S2140347E08D15FE821304008D15FE8806FF04008DCA
    S2140347F015FE8906FF04008D15FE8E060104008D46</p>
  </blockquote>
  
  <p>This is the source code:</p>
  
  <pre><code>StringList list = new StringList().FromFile(appfile.FileName);
  
          // Read file and put it in a list
          foreach (String line in list)
          {
  
              serialPort1.Write(line);
          }
  
          MessageBox.Show("Bootfile and Applicationfile are send succesfully.");
  </code></pre>