Monday, July 30, 2012

Re: ex large file

On 2012-07-30, Enda wrote:

> On July 30, 2012 6:09 PM, Gary Johnson wrote:

> > On 2012-07-30, Enda wrote:
> > > Is there a way to empty the contents of a large file? The
> > > below doesn't work:
> > >
> > >
> > > $ ex -s largefile -c '1,$d' -c wq
> > >
> > > Killed
> >
> > I don't know why that is failing. Ben had some good questions. But
> > if you just want to empty the file, use this from your shell:
> >
> > $ > largefile

> 'echo "" > filetowipe' would be a new file, I want to edit the same file.

I'm not following you. I didn't suggest redirecting to a new file.
I suggested redirecting to the same file name you used in your
example. Further, I didn't suggest using echo--I suggested simply
this command (shown this time without the shell prompt):

> largefile

where 'largefile' is the name of the file you wish to empty.

> I don't want to crash my desktop again. I think the fact that ex
> creates .swp and .swo files might contribute to the problem.

You might find this article of help:

http://vim.wikia.com/wiki/Faster_loading_of_large_files

If you can do anything with Vim that will crash your desktop, that
would be a serious bug in Vim. Does it happen with any file over
some size? How large was your 'largefile'?

Regards,
Gary

P.S.

Note that the convention on this list it to not top-post. See the
footer of every message on this list.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment