title: How can I extract specific strings from a text file and add to List?
body: <p>This is the code I am using now:</p>
  <pre><code>private void words(string path)
  {
      List&lt;string&gt; text = new List&lt;string&gt;();
      var intro = &quot;Video File Name:&quot;;
      var words = File.ReadAllLines(path)
          .Where(line =&gt; line.StartsWith(intro))
          .Select(line =&gt; line.Substring(intro.Length).Trim());   
  }
  </code></pre>
  <p>The variable path is a link of text file.
  This is the content format of the text file:</p>
  <pre><code>Video File Name: MVI_4523.MOV
   
  Lightning Start Location At Frame: 11     Lightning End Location At Frame: 15
  Lightning Start Location At Frame: 6     Lightning End Location At Frame: 15
   
  Video File Name: MVI_4524.MOV
   
  Lightning Start Location At Frame: 15     Lightning End Location At Frame: 19
  Lightning Start Location At Frame: 4     Lightning End Location At Frame: 19
  </code></pre>
  <p>What i want to do is to parse all video files names from the text file to a <code>List&lt;string&gt;</code> for example the List content will be:</p>
  <blockquote>
  <p>index[0] MVI_4523.MOV</p>
  <p>index[1] MVI_4524.MOV</p>
  </blockquote>
  <p>Then I want to loop over the List and compare each index to a variable I have: like string variable = <code>videoFile</code></p>
  <p>For example:</p>
  <pre><code>for (int i = 0; i &lt; videosfilesnames.Length; i++)
  {
      if (videosfilesnames[i] == videoFile)
      {
          // Here I want to extract from the text file the lightnings values that are belong to the matched video file name for example if MVI_4524.MOV was == to videoFile so here i want to extract the values from the text file: 15 19 and 4 19
          // Then in the end i need to create/draw point red point on the locations 15 to 19 and 4 to 19
          //  So when extracting the values I need to be able to know that 15 is start and 19 end.
      }
  }
  </code></pre>