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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…