Is there any sed like utility for cmd.exe? [closed

2018-12-31 22:21发布

I want to programmatically edit file content using windows command line (cmd.exe). In *nix there is sed for this tasks. Is there any usefull equivalent in windows?

Edit: I am looking for native command line solution.

标签: windows sed cmd
17条回答
长期被迫恋爱
2楼-- · 2018-12-31 22:28

You could install Cygwin (http://www.cygwin.com/) and use sed from there.

查看更多
只靠听说
3楼-- · 2018-12-31 22:30

I use Cygwin. I run into a lot of people that do not realize that if you put the Cygwin binaries on your PATH, you can use them from within the Windows Command shell. You do not have to run Cygwin's Bash.

You might also look into Windows Services for Unix available from Microsoft (but only on the Professional and above versions of Windows).

查看更多
妖精总统
4楼-- · 2018-12-31 22:31

Try fart.exe. It's a Find-and-replace-text utility that can be used in command batch programs.

http://sourceforge.net/projects/fart-it/

查看更多
刘海飞了
5楼-- · 2018-12-31 22:32

I needed a sed tool that worked for the Windows cmd.exe prompt. Eric Pement's port of sed to a single DOS .exe worked great for me.

It's pretty well documented.

查看更多
无色无味的生活
6楼-- · 2018-12-31 22:37

UnxUtils provides sed for Win32, as does GNUWin32.

查看更多
永恒的永恒
7楼-- · 2018-12-31 22:39

You could look at GNU Tools, they provide (amongst other things) sed on windows.

查看更多
登录 后发表回答