1

I try to open a file with vi, but it says:

Line too long

I read topic vi: Line too long, but the only two solutions (install Vim, use sed, AWK, fold, less) aren't viable.

The file that I pretend to open, has more than 400.000 lines, and commands like more, or sed, or fold, or view don't work, because I don't know the specific line number. Installing another program is descarted.

I want navigate in a file, especially on the last lines.

The operating system is a SunOS 5.8, and the commands or editors or programs that you will propose to me has to be installed on this version.

Initially I discarded the tail command, but I think that is the unique solution.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

2 Answers2

1

Finally the solution using "tail" with arguments of the last lines to show.

With this command and "more" I can navigate to the last lines and jump over the line with the too-long-problem:

tail -1000 file-with-line-too-long.txt | more

It's a managed and limited machine without permissions to install any programs.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

:$ moves you to the beginning of the last line.

It also works from the command line (you may have to escape the $):

vi +$ /path/to/file
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Thomas L.
  • 104
  • 8
  • 1
    Thank but not working. It moves to de line before of the "long line" and says the same "Line too long". In other file that lines aren't not too long, this command it works. –  Aug 30 '13 at 11:13
  • Sorry, the solaris vi just stops loading the file at the "line too long"; there's no way but either install (or self-compile) vim :( – Thomas L. Sep 02 '13 at 09:58