Editing a big file in vi - Out of register space (ugh)

Posted on 2007-08-09
Last Modified: 2013-12-13
I am editing a very big log file (1.2million lines) on unix in vi. If I try to delete a lot of lines (e.g. 100000) with the dd command I get the message "Out of register space (ugh)". Does anyone know a way around this? (and yes, I know I should have cleaned the file up a bit sooner!)
Question by:Scoteq
    LVL 24

    Accepted Solution

    you can try another delete command like
    12,.d or the like
    that means kill from a certain line up to the current line.

    I'd argue dd may try to save the killed lines into a buffer for later "insertion" I'm not fully sure that d does not always but it's worth a try.

    LVL 1

    Author Comment

    Sorry to take so long to get back to you, in fact I was waiting for my files to become big again to test! This command does indeed seem to work were 'dd' fails.
    Thanks for your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now