在文件中查找和替换 - UTF8
搜索一个免费的商业用途应用程序,允许在多个文件中查找/替换(正则表达式很好,但不是必须的),支持以 UTF-8 格式打开和保存。
尝试了一些类似 BKReplaceEm 的方法,但应用程序最终将所有文件保存为 ASCII,这会导致 Web 渲染出现一些问题。
请指教。
[更新] 为了进一步澄清,我正在寻找一个 Windows 实用程序。
[更新 #2] 这将用于运行我们的 450 页网站,并将所有法语字符替换为急需的 HTML 实体。
Searching for a free application for commercial usage that allows find/replace in multiple files (regular expressions are nice but not a must), that supports opening and saving in UTF-8.
Tried a few like BKReplaceEm but the application ends up saving all the files as ASCII which causes some problems with web-rendering.
Please advise.
[UPDATE] To further clarify, I am searching for a windows utility.
[UPDATE #2] This is going to be used to run through our 450 page site and replace all french characters with the much needed HTML entities.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Notepad++ 支持此功能,并且就其本身而言是一个很棒的小编辑器。
编辑:实际上,Notepad++ 确实支持文件替换。点击搜索->在文件中查找,然后在对话框中选择“在文件中替换”。
Notepad++ supports this feature, and is a great little editor in it's own regard.
Edit : Actually, Notepad++ does support replace in files. Click Search -> Find in Files, then select "Replace in files" in the dialog.
本着先前答案的精神,您可以使用 Perl(它具有无缝的本机 Unicode 支持,并且其 RegEx 功能是无与伦比的)。有可用的 Windows perl 版本(ActivePerl、Strawberry,或者您可以使用 CygWin),您甚至可以在其之上添加 GUI -= 对于后者,你可以看到我最近提出的问题的答案:)
另外,Perl 可以通过使用获取几乎无限强大的文件集合glob 用于简单的事情,File::Find 用于更复杂的事情,如果您需要更多奇特的东西,例如通过修改时间的内容,则在结果文件列表上使用 grep 进一步细化。
更新 对于 Windows 编辑器,您可以使用 UltraEdit。它有免费评估期,说实话,我发现购买这个非常漂亮且功能强大的编辑器的价格非常值得。在其其他功能中,它支持 Unicode,并且具有非常奇特的搜索/替换功能能力,包括 Perl RegEx 支持和多个文件中的 S/R。
In the spirit of previous answer, you can use Perl (which has seamless native Unicode support and whose RegEx capablity are unparalleled). There are Windows perl versions avialable (ActivePerl, Strawberry, or you can use CygWin), and you can even slap GUIs on top of it -= for the latter, you can see what answers are given to my very recent So question :)
Plus, Perl can grab pretty much unlimitedly powerful collection of files, by using globs for simple things, File::Find for more complicated, and using grep on resulting file list to refine further if you need more fancy stuff, e.g. by content of modification time.
UPDATE For a Windows Editor, you can use UltraEdit. It has free evaluation period, and to be perfectly honest, I find the purchase price to be WELL worth paying for this very nice and powerful editor. Among its other features, it supports Unicode, and has pretty fancy search/replace ablities, including Perl RegEx support and S/R in multiple files.
使用
sed
。Use
sed
.jEdit 有一个名为“HyperSearch”的功能(只需打开查找对话框)。您可以指定一个目录、文件名模式,jEdit(基于 Java)确实支持许多不同的编码(并且通常足够聪明,可以找出正确的编码)。
jEdit has a feature called "HyperSearch" (just open the find dialog). You can specify a directory, a file name pattern and jEdit (being based on Java) does support lots of different encodings (and is often smart enough to figure out the correct one).
你可以尝试我的编辑器,Code Trowel
如果它没有达到你想要的效果,我可能会修复它: -)
You could try my editor, Code Trowel
If it doesn't do what you want I'd probably fix it :-)
对于 Windows,Notepad++ 非常棒。它是根据 GPL 授权的。它可以在文件中搜索和替换,并且支持正则表达式。
For windows, Notepad++ is awesome. It's licensed under the GPL. It does search and replace in files and does support regular expressions.