title: How to add the values to the List<long[]> from the text file?
body: <p>I have a text file this is a small part of him its format:</p>
  
  <pre><code>DANNY VIDEO HISTOGRAM DATA
  FORMAT VERSION:1.00
  SOURCE: &lt;MVI_2483.AVI_Automatic&gt;
  DATA: 
  Frame 000000: 5977,40775,174395,305855,265805
  Frame 000001: 5432,21333,456789,123456,111111
  </code></pre>
  
  <p>Now every line Frame.....Have 256 numbers 5977,40775,174395,305855,265805
  In the example i show here only 5 numbers but each line/frame have 256 numbers.</p>
  
  <p>In Form1 i have a List: List Histograms</p>
  
  <p>What i need to do is to read the text file in this case the text file name is Histograms.txt to read the text file and each line/frame with 256 numbers i need to add back to the List.
  So the List Histograms will be in the end that in index [0] for example i will have 256 indexes in [0] 5977 in <a href="https://i.stack.imgur.com/hcrUp.jpg" rel="nofollow noreferrer">1</a> 40775 in [2] 174395 in [3] 305955 in [4] 265805 and so on 256 numbers.</p>
  
  <p>Then in index <a href="https://i.stack.imgur.com/hcrUp.jpg" rel="nofollow noreferrer">1</a> again 256 numbers ...
  Then in index [2] and so on...</p>
  
  <p>In the end i should have in the List 3803 index that each index have inside 256 index that each one contain a number.</p>
  
  <p>This is the code of how i am writing the text file when the List is with the numbers and then when i am running the program again i need that it will read and load the text file back to the List. When i am running the program the List is empty.</p>
  
  <pre><code>private void WriteHistograms() // For automatic mode only for now
  {
      HistogramsFile = new StreamWriter(_outputDir + "\\" + averagesListTextFileDirectory + "\\"  + "Histograms.txt", false, Encoding.ASCII);
      HistogramsFile.WriteLine("DANNY VIDEO HISTOGRAM DATA\r\nFORMAT VERSION:1.00\r\nSOURCE: " + "&lt;" + averagesListTextFile + "&gt;" + "\r\nDATA: ");
      for (int i = 0; i &lt; Histograms.Count; i++)
      {
          HistogramsFile.Write("Frame " + i.ToString("D6") + ": ");
          for (int x = 0; x &lt; Histograms[i].Length; x++ )
          {
              HistogramsFile.Write(Histograms[i][x] + ",");
          }
          HistogramsFile.WriteLine("!");
      }
      HistogramsFile.WriteLine("DATA");
      HistogramsFile.Close();
  }
  </code></pre>
  
  <p>Now i have another function: LoadHistograms(), i need to read the text file and add back the numbers to the List.</p>
  
  <p>I added now a photo of the List how it is when writing it to the text file and how the List should looks like after reading it back from the text file.</p>
  
  <p><img src="https://i.stack.imgur.com/hcrUp.jpg" alt="enter image description here"></p>