2

I have a file that has several times my RAM capacity and I need to edit it, search for some expressions, etc.

I've tried Vim (with LargeFiles plugin and CTRL + C trick), joe, shed all without luck.

The other option I could have it so use sed, even though by using the replace in whole file it would take a lot of time.

My file is an SQL dump, but it should work for any kind of text.

Any suggestions?

NOTE: it's mandatory that it would not change file unless I command to do it, so Vim + CTRL + C trick is out of question.

  • 1
    Did you see this Q on askubuntu? askubuntu.com/questions/28847/… – pLumo Jan 7 at 16:54
  • 1
    Are your changes something that you can represent with regular expressions? – Jeff Schaller Jan 7 at 17:03
  • 2
    Got enough disk-space for a split & merge? – tink Jan 7 at 17:06
  • 4
    It depends on what edit you want to make. If you want replace foo with bar (replace a chunk with another one of the same length, without having to shift forwards or backwards what comes after it) -- fine. You can do it in place and without having to process the whole file. Please add those details to your question. In any case, do not try to load a +GB file in vim ;-) – Uncle Billy Jan 7 at 17:32
  • 4
    Note that sed may very well copy the file to a temporary location, so if you don't have enough space for a split & merge, you may not have enough for sed. – Jeff Schaller Jan 7 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.