How can i extract a string text from a file using loop while all over the file?
<p>For example i have this:</p>

<blockquote>
  <p>"Was? Wo war ich? Ach ja.&lt;pa&gt;"></p>
</blockquote>

<p>I need to create a new text file that will contain only:</p>

<blockquote>
  <p>Was? Wo war ich? Ach ja.</p>
</blockquote>

<p>And i have a big file like 43mb and i need to scan all over the file and get only the places that start with <code>"</code> and end with <code>&lt;pa&gt;"</code> and to get the string between this tags.</p>

<p>I did this code so far:</p>

<pre><code>private void retrivingTestText()
        {
            w = new StreamWriter(retrivedTextFile);
            string startTag = "\"";
            string endTag = "&amp;lt;pa&amp;gt;";
            int startTagWidth = startTag.Length;
            int endTagWidth = endTag.Length;
            string text = "\"Was? Wo war ich? Ach ja.&amp;lt;pa&amp;gt;\"&gt;";

            int begin = text.IndexOf(startTag);
            int end = text.IndexOf(endTag, begin + 1);

            string result = text.Substring(begin+1, end-1);
            w.WriteLine(result);
            w.Close();


        }
</code></pre>

<p>But now i need to make it on a big file 43mb xml file. 
So in the constructor i already did StreamReader r;
And string f;
Then i did :</p>

<pre><code>r = new StreamReader(@"D:\New folder (22)\000004aa.xml")
f = r.ReadToEnd();
</code></pre>

<p>Now i need to use it with the code above to extract all the strings in the big file between the startTag and endTag and not only specific text.</p>

<p>Second thing i need to make another function so after i make changes it will know to add back all the extractes text strings to the right places where it was before between the startTag and the endTag</p>

<p>Thanks.</p>
