title: Looping though an array, taking a subset at each iteration and store into list of objects
body: <p>I'm reading strings from a text file into an <code>string[]</code>. The text file has data in sequence, for example, the <em>first</em> <code>7</code> elements are considered to be <em>one record</em>, and the <em>next</em> <code>7</code> elements are considered a <em>second record</em>, etc.</p>
  
  <p>I need to store these records in objects, so at the end I will have a list of objects (<code>List&lt;Settlement&gt;</code>).</p>
  
  <p>I have looked for solutions which suggest using <strong>LINQ</strong>, but I have no background in it.</p>
  
  <p>Here is a sample file </p>
  
  <pre class="lang-cs prettyprint-override"><code>public static List&lt;Settlement&gt; ReadFromLogFile()
  {
      string filename = path + @"\BM_DB_MIGRATION.txt";
      List&lt;Settlement&gt; settlements = new List&lt;Settlement&gt;();
  
      if (File.Exists(filename))
      {
          string[] lines = File.ReadAllLines(filename);
  
          // Reading 7 elements from lines into an object of Settelment at each iteration 
          // and store the object in a list of objects...
      }
  
      return settlements;
  }
  </code></pre>