title: Extract data from text files and make a list from them C#
body: <p>Having trouble figuring this out.</p>
  
  <p>I have to read text files with data and want to convert each of them into an array.</p>
  
  <p>DataList</p>
  
  <pre><code>dataOne
  dataTwo
  dataThree
  etc.....
  </code></pre>
  
  <p>ItemList</p>
  
  <pre><code>listOne
  listTwo
  listThree
  etc.....
  </code></pre>
  
  <p>so read the Items and store them in a list</p>
  
  <pre><code>List&lt;string&gt; dataList = new List&lt;string&gt;();
  List&lt;string&gt; itemList = new List&lt;string&gt;();
  </code></pre>
  
  <p>Then <code>Console.WriteLine</code> the list </p>
  
  <pre><code>Console.WriteLine(dataList[0] + itemList[0]);
  </code></pre>
  
  <p>I have been trying to use <code>StreamReader</code> to input the text files, but it doesn't seem to add them to a array</p>
  
  <pre><code>string dataListFile = @"..\..\FileIOExtraFiles\DataFieldsLayout.txt";
              StreamReader dataFile = new StreamReader(dataListFile);
  </code></pre>