vi:线太长 [英] vi: Line too long

查看:184
本文介绍了vi:线太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用vi分析日志文件时,有时会遇到以下错误:行过长".我可以使用more观看文件,但这不是我想要的.

When I use vi to analyze log files, it sometimes is stuck with the error: 'Line too long'. I can watch the file using more, but that's not what I want.

命令视图将导致相同的结果,并且未安装less.

The command view leads to the same result and less is not installed.

系统为HP-UX v B.11.31 U ia64

System is HP-UX v B.11.31 U ia64

  1. 此错误是什么意思? vi确实对每行允许多少个字符有限制吗?
  2. 有没有解决方法,无论如何如何打开文件并在vi中显示?

推荐答案

(1)显然是这样的:-)

(1) Apparently so :-)

我以前从未遇到过vim (a)的限制,但可能是HPUX附带的vi不是vim.

I've never run into a limitation in vim (a) before but it may be that the vi shipping with HPUX is not vim.

(2)您对使用vi的日志文件进行哪种分析?

(2) What sort of analysis are you doing on log files with vi?

这是一种任务,非常适合按sedawkPerl之类的文本处理工具,以增强功能.

This is the sort of task perfectly suited to text processing tools like sed, awk and Perl, in order of increasing awesomeness.

(a):如果您还没有,请考虑使用vim.在文档的vi_diff部分(vivim之间的差异):

(a): You may want to consider grabbing vim if you don't have it already. From the vi_diff part of the documentation (differences between vi and vim):

Vim对于可以编辑的文件只有几个限制{Vi:不能处理大于128的字符和字符,具有有限的行长,还有许多其他限制}.

Vim has only a few limits for the files that can be edited {Vi: can not handle characters and characters above 128, has limited line length, many other limits}.

最大行长:在具有16位整数(Amiga和MS-DOS实模式)的计算机上:32767,否则为2147483647个字符.较长的行被分割.

Maximum line length: On machines with 16-bit ints (Amiga and MS-DOS real mode): 32767, otherwise 2147483647 characters. Longer lines are split.

最大行数:2147483647行.

Maximum number of lines: 2147483647 lines.

最大文件大小:长整数为32位时,为2147483647字节(2 GB). 64位长的更多内容.还受交换文件可用磁盘空间的限制.

Maximum file size: 2147483647 bytes (2 Gbyte) when a long integer is 32 bits. Much more for 64 bit longs. Also limited by available disk space for the swap-file.

这篇关于vi:线太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆