用于打开大(巨大、巨大、大)文本文件的文本编辑器

发布于 2024-07-07 03:06:36 字数 105 浏览 9 评论 0原文

我的意思是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

春风十里 2024-07-14 03:06:36

免费只读查看器:

  • 大文本文件查看器 (Windows) – 完全可定制的主题(颜色、字体、自动换行、选项卡大小)。 支持水平和垂直分割视图。 还支持文件跟踪和正则表达式搜索。 非常快、简单,并且可执行文件大小小。
  • klogg(Windows、macOS、Linux) – glogg。 其主要特点是正则表达式搜索。 它支持监视文件更改(如 tail)、书签、使用不同颜色突出显示模式,并且内置了严格的优化。但从 UI 的角度来看,它相当小。
  • LogExpert (Windows) – “tail 的 GUI 替代品。” 它实际上是一个日志文件分析器,而不是一个大型文件查看器,在一项测试中,它需要 10 秒和 700 MB RAM 才能加载 250 MB 文件。 但它的杀手级功能是分栏器(解析 CSV、JSONL 等格式的日志并以电子表格格式显示)和荧光笔(以特定颜色显示包含特定单词的行)。 还支持文件跟踪、选项卡、多文件、书签、搜索、插件和外部工具。
  • Lister (Windows) – 非常小且简约。 它是一个可执行文件,只有 500 KB,但它仍然支持搜索(使用正则表达式)、打印、十六进制编辑器模式和设置。

免费编辑器:

  • 您的常规编辑器或 IDE。 现代编辑器可以处理大得惊人的文件。 特别是 Vim(Windows、macOS、Linux)、Emacs(Windows、macOS、Linux),Notepad++ (Windows)、Sublime Text(Windows、macOS、Linux)和VS Code (Windows、macOS、Linux)支持大文件(~4 GB),假设您有 RAM。
  • 大文件编辑器 (Windows) – 打开和编辑TB+ 文件,支持 Unicode,使用很少的内存,具有 XML 特定的功能,并包括二进制模式。
  • GigaEdit (Windows) – 支持搜索、字符统计和字体自定义。 但它有缺陷——对于大文件,它只允许覆盖字符,而不能插入它们; 它不将 LF 视为行终止符,仅将 CRLF 视为行终止符; 而且速度很慢。

内置程序(无需安装):

  • less (macOS , Linux) – 传统的 Unix 命令行寻呼工具。 允许您查看几乎任何大小的文本文件。 也可以安装在 Windows 上。
  • 记事本 (Windows) – 适合处理大文件,尤其是自动换行关掉。
  • 更多 (Windows) – 这是指 Windows 更多,而不是 Unix more。 一种控制台程序,允许您一次一个屏幕地查看文件。

Web 查看器:

付费编辑者/观众:

  • 010 编辑器(Windows、macOS、Linux)-打开巨型(大至 50 GB)文件。
  • SlickEdit(Windows、macOS、Linux) – 打开大文件。
  • UltraEdit(Windows、macOS、Linux) – 打开超过 6 GB 的文件,但必须更改配置才能使其实用:菜单 » 高级 » 配置 » 文件处理 » 临时文件 » 打开没有临时文件的文件...
  • EmEditor (Windows) – 可以很好地处理非常大的文本文件(官方说法最大为 16 TB)。 查找和替换的速度非常快。 免费版本可供个人使用。
  • BssEditor (Windows) – 处理大文件和很长的行。 不需要安装。 免费用于非商业用途。
  • loxx (Windows) – 支持文件跟踪、突出显示、行号、大文件、正则表达式、多个文件和视图等等。 免费版本不能:处理正则表达式、过滤文件、同步时间戳和保存更改的文件。

Free read-only viewers:

  • Large Text File Viewer (Windows) – Fully customizable theming (colors, fonts, word wrap, tab size). Supports horizontal and vertical split view. Also support file following and regex search. Very fast, simple, and has small executable size.
  • klogg (Windows, macOS, Linux) – A maintained fork of glogg. Its main feature is regular expression search. It supports monitoring file changes (like tail), bookmarks, highlighting patterns using different colors, and has serious optimizations built in. But from a UI standpoint, it's rather minimal.
  • LogExpert (Windows) – "A GUI replacement for 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.
  • Lister (Windows) – Very small and minimalist. It's one executable, barely 500 KB, but it still supports searching (with regexes), printing, a hex editor mode, and settings.

Free editors:

  • Your regular editor or IDE. Modern editors can handle surprisingly large files. In particular, Vim (Windows, macOS, Linux), Emacs (Windows, macOS, Linux), Notepad++ (Windows), Sublime Text (Windows, macOS, Linux), and VS Code (Windows, macOS, Linux) support large (~4 GB) files, assuming you have the RAM.
  • Large File Editor (Windows) – Opens and edits TB+ files, supports Unicode, uses little memory, has XML-specific features, and includes a binary mode.
  • GigaEdit (Windows) – Supports searching, character statistics, and font customization. But it's buggy – with large files, it only allows overwriting characters, not inserting them; it doesn't respect LF as a line terminator, only CRLF; and it's slow.

Builtin programs (no installation required):

  • less (macOS, Linux) – The traditional Unix command-line pager tool. Lets you view text files of practically any size. Can be installed on Windows, too.
  • Notepad (Windows) – Decent with large files, especially with word wrap turned off.
  • MORE (Windows) – This refers to the Windows MORE, not the Unix more. A console program that allows you to view a file, one screen at a time.

Web viewers:

Paid editors/viewers:

  • 010 Editor (Windows, macOS, Linux) – Opens giant (as large as 50 GB) files.
  • SlickEdit (Windows, macOS, Linux) – Opens large files.
  • UltraEdit (Windows, macOS, Linux) – Opens files of more than 6 GB, but the configuration must be changed for this to be practical: Menu » Advanced » Configuration » File Handling » Temporary Files » Open file without temp file...
  • EmEditor (Windows) – Handles very large text files nicely (officially up to 16 TB). The speed of search and replace is very fast. Free version available for personal use.
  • BssEditor (Windows) – Handles large files and very long lines. Don’t require an installation. Free for non commercial use.
  • loxx (Windows) – Supports file following, highlighting, line numbers, huge files, regex, multiple files and views, and much more. The free version can not: process regex, filter files, synchronize timestamps, and save changed files.
最终幸福 2024-07-14 03:06:36

提示和技巧

less

为什么您使用编辑器查看(大)文件?

在 *nix 或 Cygwin 下,只需使用 更少。 (有一句名言——“少即是多,多或少”——因为“less”取代了早期的 Unix 命令“more”,并且还可以向上滚动。)在 less 下搜索和导航与Vim,但没有交换文件,并且使用的 RAM 很少。

GNU 的 Win32 端口较少。 请参阅上面答案的“较少”部分。

Perl

Perl 非常适合快速脚本,它的 ..(范围触发器)运算符提供了一个很好的选择机制,可以限制您必须费力处理的繁琐内容。

例如:

$ perl -n -e 'print if ( 1000000 .. 2000000)' humongo.txt | less

这将提取从第 100 万行到第 200 万行的所有内容,并允许您手动筛选输出。

另一个例子:

$ perl -n -e 'print if ( /regex one/ .. /regex two/)' humongo.txt | less

当“正则表达式一”找到某些内容时开始打印,并在“正则表达式二”找到感兴趣的块的末尾时停止。 它可能会找到多个块。 筛选输出...

logparser

这是您可以使用的另一个有用的工具。 引用维基百科文章

logparser 是一个灵活的命令行实用程序,最初由 Microsoft 员工 Gabriele Giuseppini 编写,用于自动执行 IIS 日志记录测试。 它旨在与 Windows 操作系统一起使用,并包含在 IIS 6.0 资源工具包工具中。 logparser 的默认行为类似于“数据处理管道”,通过在命令行上获取 SQL 表达式,并输出包含 SQL 表达式匹配的行。

Microsoft 将 Logparser 描述为一个功能强大的多功能工具,它提供对基于文本的数据(例如日志文件、XML 文件和 CSV 文件)以及 Windows 操作系统上的关键数据源(例如事件日志、注册表、文件系统和 Active Directory。 输入查询的结果可以在基于文本的输出中自定义格式,或者可以将它们保留到更专业的目标,例如 SQL、SYSLOG 或图表。

用法示例:

C:\>logparser.exe -i:textline -o:tsv "select Index, Text from 'c:\path\to\file.log' where line > 1000 and line < 2000"
C:\>logparser.exe -i:textline -o:tsv "select Index, Text from 'c:\path\to\file.log' where line like '%pattern%'"

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:

$ perl -n -e 'print if ( 1000000 .. 2000000)' humongo.txt | less

This will extract everything from line 1 million to line 2 million, and allow you to sift the output manually in less.

Another example:

$ perl -n -e 'print if ( /regex one/ .. /regex two/)' humongo.txt | less

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:

logparser is a flexible command line utility that was initially written by Gabriele Giuseppini, a Microsoft employee, to automate tests for IIS logging. It was intended for use with the Windows operating system, and was included with the IIS 6.0 Resource Kit Tools. The default behavior of logparser works like a "data processing pipeline", by taking an SQL expression on the command line, and outputting the lines containing matches for the SQL expression.

Microsoft describes Logparser as a powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows operating system such as the Event Log, the Registry, the file system, and Active Directory. The results of the input query can be custom-formatted in text based output, or they can be persisted to more specialty targets like SQL, SYSLOG, or a chart.

Example usage:

C:\>logparser.exe -i:textline -o:tsv "select Index, Text from 'c:\path\to\file.log' where line > 1000 and line < 2000"
C:\>logparser.exe -i:textline -o:tsv "select Index, Text from 'c:\path\to\file.log' where line like '%pattern%'"

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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文