我想使用 Windows 命令行以编程方式编辑文件内容(cmd.exe http://en.wikipedia.org/wiki/Windows_command_line)。在*nix中有sed http://en.wikipedia.org/wiki/Sed对于这个任务。 Windows 中是否有任何有用的本机等效项(cmd 或 ps)?
今天 powershell 救了我。
For grep有:
get-content somefile.txt | where { $_ -match "expression"}