title: Find and Replace in a Large File
body: <p>I want to find a piece of text in a large xml file and want to replace with some other text. The size of the file is around (50GB). I want to do this in command line. I am looking at PowerShell and want to know if it can handle the large size.</p>
  <p>Currently I am trying something like this but it does not like it</p>
  <pre><code>Get-Content C:\File1.xml | Foreach-Object {$_ -replace &quot;xmlns:xsi=\&quot;http:\/\/www\.w3\.org\/2001\/XMLSchema-instance\&quot;&quot;, &quot;&quot;} | Set-Content C:\File1.xml
  </code></pre>
  <p>The text I want to replace is  <code>xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</code> with an empty string <code>&quot;&quot;</code>.</p>
  <p>Questions</p>
  <ol>
  <li>Can PowerShell handle large
  files</li>
  <li>I don't want the replace to happen in
  memory and prefer streaming assuming
  that will not bring the server to
  its knees.</li>
  <li>Are there any other approaches I can take (different
  tools/strategy?)</li>
  </ol>
  <p>Thanks</p>