title: Read a file and sort it alphabetically by certain rules
body: <p>I need to read a list of names from a text file <code>nameInput.txt</code>, the names are formatted as <code>first_name,last_name</code>, one pair per line.</p>
  
  <p>For example:</p>
  
  <pre><code>David,Smith
  Russell,Jones
  Andrew,Jones
  </code></pre>
  
  <p>Then I need to arrange it in alphabetical order by with primary key last name, secondary key first name, for example:</p>
  
  <pre><code>Jones Andrew
  Jones Russell
  Smith David 
  </code></pre>
  
  <p>Last, I need to write the sorted data to another file <code>nameOutput.txt</code>, the names are written as one pair per row in <code>last_name first_name</code> order, for example:</p>
  
  <pre><code>Jones Andrew
  Jones Russell
  Smith David
  </code></pre>
  
  <p>This is my code currently:</p>
  
  <pre><code>    class MainClass
  {
      public static void Main (string[] args)
      {
  
          List&lt;string&gt; list = new List&lt;string&gt; ();
          using (StreamReader reader = new StreamReader("Documents/inputName.txt"))
          {
              string line;
              while ((line = reader.ReadLine()) != null) 
              {
                  list.Add (line);
                  Console.WriteLine (line);
              }
          }
      }
  }
  </code></pre>