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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/159521/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 12:07:31  来源:igfitidea点击:

Text editor to open big (giant, huge, large) text files

windowsxmleditortext-editorlarge-files

提问by Yuvi

I mean 100+ MB big; such text files can push the envelope of editors.

我的意思是 100+ MB 大;这样的文本文件可以推动编辑的信封。

I need to look through a large XML file, but cannot if the editor is buggy.

我需要查看一个大型 XML 文件,但如果编辑器有问题,则无法查看。

Any suggestions?

有什么建议?

回答by Nick Ryberg

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 can also watch files, allows the user to mark lines, and has serious optimizations built in. But from a UI standpoint, it's ugly and clunky.
  • 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.
  • 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.
  • 大文本文件查看器(Windows) – 完全可定制的主题(颜色、字体、自动换行、标签大小)。支持水平和垂直拆分视图。还支持文件跟踪和正则表达式搜索。非常快速、简单,并且可执行文件很小。
  • klogg(Windows, macOS, Linux) –glogg 的一个维护分支,其主要功能是正则表达式搜索。它还可以查看文件,允许用户标记行,并内置了严重的优化。但从 UI 的角度来看,它既丑陋又笨拙。
  • LogExpert(Windows) – “.GUI 的替代品tail。” 它实际上是一个日志文件分析器,而不是一个大型文件查看器,在一次测试中,它需要 10 秒和 700 MB 的 RAM 才能加载 250 MB 的文件。但它的杀手级功能是列化器(解析 CSV、JSONL 等格式的日志并以电子表格格式显示)和荧光笔(用某些颜色显示某些单词的行)。还支持文件跟踪、标签、多文件、书签、搜索、插件和外部工具。
  • Lister(Windows) – 非常小巧简约。它是一个可执行文件,只有 500 KB,但它仍然支持搜索(使用正则表达式)、打印、十六进制编辑器模式和设置。
  • loxx(Windows) – 支持文件跟踪、突出显示、行号、大文件、正则表达式、多个文件和视图等等。免费版不能:处理正则表达式、过滤文件、同步时间戳和保存更改的文件。

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.
  • 您的常规编辑器或 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;而且速度很慢。

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.
  • less(macOS, Linux) – 传统的 Unix 命令行分页工具。让您查看几乎任何大小的文本文件。也可以安装在 Windows 上。
  • 记事本(Windows) – 适合大文件,尤其是在关闭自动换行的情况下。
  • MORE(Windows) – 这是指 WindowsMORE,而不是 Unixmore。一个控制台程序,允许您一次一个屏幕地查看文件。

Web viewers:

网络浏览器:

Paid editors:

付费编辑:

  • 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 248 GB, but as much as 900 GB according to one report).
  • 010 Editor(Windows、macOS、Linux)——打开巨型(大至 50 GB)文件。
  • SlickEdit(Windows、macOS、Linux)——打开大文件。
  • UltraEdit(Windows、macOS、Linux)——打开超过 6 GB 的文件,但必须更改配置才能使其实用:菜单 ? 先进的 ?配置 ?文件处理 ? 临时文件 ? 打开没有临时文件的文件...
  • EmEditor(Windows) – 可以很好地处理非常大的文本文件(官方最高可达 248 GB,但根据一份报告最多可达 900 GB)。

回答by Roboprog

Tips and tricks

技巧和窍门

less

较少的

Why are you using editorsto just lookat 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.

在 *nix 或Cygwin 下,只需使用less。(有一句名言——“less is more, more or less”——因为“less”取代了早期的Unix命令“more”,增加了你可以向上滚动的功能。)在less下搜索和导航非常类似于Vim,但没有交换文件,使用的 RAM 很少。

There is a Win32 port of GNU less. See the "less" section of the answer above.

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

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.

Perl 适用于快速脚本,它的..(范围触发器)操作符提供了一个很好的选择机制来限制你必须涉足的问题。

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.

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

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:

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

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

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

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

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.

100 MB 不算大。3 GB 越来越大了。我曾经在一家印刷和邮件机构工作,该机构创造了大约 2% 的美国一流邮件。我担任技术负责人的系统之一约占邮件的 15% 以上。我们有一些大文件要在这里和那里调试。

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

请随意在此处添加更多工具和信息。这个答案是社区维基是有原因的!我们都需要更多关于处理大量数据的建议......