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. Also I would like to the know the syntax for escaping the key operators in powershell. I am a PowerShell newbie
Currently I am trying something like this but it does not like it
Get-Content C:\File1.xml | Foreach-Object {$_ -replace "xmlns:xsi=\"http:\/\/www\.w3\.org\/2001\/XMLSchema-instance\"", ""} | Set-Content C:\File1.xml
The text I want to replace is xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" with empty string "".
Questions
- Can powerShell handle large files
- How do I call the powershell script from command line
- The syntax for escaping key operators in powerShell and the list of key operators in powerShell.
- I don't want the replace to happen in memory and prefer streaming assuming that will not bring the server to its knees.
- Are there any other approaches I can take (Different tools / strategy ?)
Thanks