Issue
I want to programmatically edit file content using windows command line (cmd.exe). In *nix there is href="http://en.wikipedia.org/wiki/Sed" rel="noreferrer">sed for this tasks. Is there any useful native equivalent in windows?
Solution
Today powershell saved me.
For grep
there is:
get-content somefile.txt | where { $_ -match "expression"}
or
select-string somefile.txt -pattern "expression"
and for sed
there is:
get-content somefile.txt | %{$_ -replace "expression","replace"}
For more detail about replace PowerShell function see this Microsoft article.
Answered By - Jakub Šturc Answer Checked By - Robin (WPSolving Admin)