用于打开大(巨大、巨大、大)文本文件的文本编辑器
我的意思是 100+ MB 大; 此类文本文件可以挑战编辑人员的极限。
我需要查看一个大的 XML 文件,但如果编辑器有问题则无法查看。
有什么建议么?
I mean 100+ MB big; such text files can push the envelope of editors.
I need to look through a large XML file, but cannot if the editor is buggy.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
免费只读查看器:
tail
)、书签、使用不同颜色突出显示模式,并且内置了严格的优化。但从 UI 的角度来看,它相当小。tail 的 GUI 替代品。” 它实际上是一个日志文件分析器,而不是一个大型文件查看器,在一项测试中,它需要 10 秒和 700 MB RAM 才能加载 250 MB 文件。 但它的杀手级功能是分栏器(解析 CSV、JSONL 等格式的日志并以电子表格格式显示)和荧光笔(以特定颜色显示包含特定单词的行)。 还支持文件跟踪、选项卡、多文件、书签、搜索、插件和外部工具。
免费编辑器:
内置程序(无需安装):
更多
,而不是 Unixmore
。 一种控制台程序,允许您一次一个屏幕地查看文件。Web 查看器:
付费编辑者/观众:
Free read-only viewers:
tail
), bookmarks, highlighting patterns using different colors, and has serious optimizations built in. But from a UI standpoint, it's rather minimal.tail
." It's really a log file analyzer, not a large file viewer, and in one test it required 10 seconds and 700 MB of RAM to load a 250 MB file. But its killer features are the columnizer (parse logs that are in CSV, JSONL, etc. and display in a spreadsheet format) and the highlighter (show lines with certain words in certain colors). Also supports file following, tabs, multifiles, bookmarks, search, plugins, and external tools.Free editors:
Builtin programs (no installation required):
MORE
, not the Unixmore
. A console program that allows you to view a file, one screen at a time.Web viewers:
Paid editors/viewers:
提示和技巧
less
为什么您使用编辑器来查看(大)文件?
在 *nix 或 Cygwin 下,只需使用 更少。 (有一句名言——“少即是多,多或少”——因为“less”取代了早期的 Unix 命令“more”,并且还可以向上滚动。)在 less 下搜索和导航与Vim,但没有交换文件,并且使用的 RAM 很少。
GNU 的 Win32 端口较少。 请参阅上面答案的“较少”部分。
Perl
Perl 非常适合快速脚本,它的
..
(范围触发器)运算符提供了一个很好的选择机制,可以限制您必须费力处理的繁琐内容。例如:
这将提取从第 100 万行到第 200 万行的所有内容,并允许您手动筛选输出。
另一个例子:
当“正则表达式一”找到某些内容时开始打印,并在“正则表达式二”找到感兴趣的块的末尾时停止。 它可能会找到多个块。 筛选输出...
logparser
这是您可以使用的另一个有用的工具。 引用维基百科文章:
用法示例:
100 MB大小的相对性
并不算太大。 3 GB 变得有点大了。 我曾经在一家印刷厂工作。 邮件设施创造了约 2% 的美国头等邮件。 我担任技术负责人的系统之一处理了大约 15% 以上的邮件。 我们到处都有一些大文件需要调试。
还有更多...
请随意在此处添加更多工具和信息。 这个答案是社区维基是有原因的! 我们都需要更多关于处理大量数据的建议......
Tips and tricks
less
Why are you using editors to just look at a (large) file?
Under *nix or Cygwin, just use less. (There is a famous saying – "less is more, more or less" – because "less" replaced the earlier Unix command "more", with the addition that you could scroll back up.) Searching and navigating under less is very similar to Vim, but there is no swap file and little RAM used.
There is a Win32 port of GNU less. See the "less" section of the answer above.
Perl
Perl is good for quick scripts, and its
..
(range flip-flop) operator makes for a nice selection mechanism to limit the crud you have to wade through.For example:
This will extract everything from line 1 million to line 2 million, and allow you to sift the output manually in less.
Another example:
This starts printing when the "regular expression one" finds something, and stops when the "regular expression two" find the end of an interesting block. It may find multiple blocks. Sift the output...
logparser
This is another useful tool you can use. To quote the Wikipedia article:
Example usage:
The relativity of sizes
100 MB isn't too big. 3 GB is getting kind of big. I used to work at a print & mail facility that created about 2% of U.S. first class mail. One of the systems for which I was the tech lead accounted for about 15+% of the pieces of mail. We had some big files to debug here and there.
And more...
Feel free to add more tools and information here. This answer is community wiki for a reason! We all need more advice on dealing with large amounts of data...