1848613 Members
6573 Online
104033 Solutions
New Discussion

line too long for vi

 
Dave Walley
Frequent Advisor

line too long for vi

Hi.

While using grep to extract a line of 4000 characters from a file I get a coredump. I somehow managed to extract the line into another file but vi then says line too long. I tried using sed to change the data I need to but it too gives me a coredump. Is there any way of dealing with a line that is this long.

Thanking you in advance.

Dave
why do i do this to myself
5 REPLIES 5
Vincenzo Restuccia
Honored Contributor

Re: line too long for vi

You can split the file with the command split -l 200 name_file.You can see man split.
Steffi Jones_1
Esteemed Contributor

Re: line too long for vi

Hi Dave,

you are hitting a vi limitation here.
You can break down the line length by using the fold command.

check the manpage for fold, but something like that might work:

dd if= ibs=5120 obs=80 count=1 | fold -80 > test

Steffi Jones

Andreas Voss
Honored Contributor

Re: line too long for vi

Hi,

just to get this into vi you can use the command

fold >

and then edit with vi

Regards
Carsten Krege
Honored Contributor

Re: line too long for vi

I use a vi binary that doesn't have this limitation that is called "nvi". I'm not sure whether it is the same that is distributed on http://gatekeep.cs.utah.edu (or http://hpux.asknet.de), but you might want to give it a try.

If it doesn't work, I can send you mine.

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Mike Williams_3
Advisor

Re: line too long for vi

IMHO vim is the best vi editor. Get it at
www.vim.org or via the hpux porting sites.