Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Text Editor for very big file - Windows

NOt a programming question I know but related to a program I am writing, and probably a problem only likely to be encountered by programmers.

I have a really big text file which I need to edit - just need to delete the first line.

None of the standard windows programs can handle the 200MB+ file

What is the best way to edit it?

share|improve this question

migrated from stackoverflow.com Oct 5 '09 at 7:04

This question came from our site for professional and enthusiast programmers.

marked as duplicate by alex, hyperslug, harrymc, Diago Oct 6 '09 at 10:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
This question has been asked before. You can find more information here: superuser.com/questions/4044/… and here: superuser.com/questions/34749/… –  alex Oct 5 '09 at 7:28

7 Answers 7

Then don't use a 'standard windows program'.

I've use vim in Cygwin under Windows XP to edit a 400MB file.

I don't want to do it regularly, but it worked.

EDIT: Of course, installing Cygwin just so you can edit a file is probably too much, but you should consider non standard Windows programs.

I'm not sure what the limitation of Notepad++ is, and you may consider it a 'standard', but there may be a modern third-party editor which will do the job.

share|improve this answer
1  
Don't be snarky. –  Sam152 Oct 5 '09 at 7:10
    
I don't see why that's snarky (whatever that means) I'm saying don't use a standard Windows program, use a non-standard Windows program. –  pavium Oct 5 '09 at 7:21
1  
You can also install gvim under windows without cygwin. It should work just as well. –  Nathan Fellman Oct 5 '09 at 9:24

Use the sed command:

sed 1d largefile > newfile
mv newfile largefile

If you don't have sed, get Cygwin or UnxUtils for Windows.

share|improve this answer
    
if you are going to edit just 1 line and you know exactly where the line is, its far easier to use sed rather than opening the file in an interactive editor. –  Andrew Keith Oct 5 '09 at 8:25

UltraEdit (commercial) handles large files rather well.

share|improve this answer

You should be able to use a ".vbs" script to do this. (Feel free to correct me on this one - I haven't checked the code properly)

Create a file called CopyAllButLine1.vbs, and enter the following: ({firstfile} and {secondfile} are the names of your files)

Set objFile = objFSO.OpenTextFile ("{firstfile}", 1)
Set outfile = objFSO.OpenTextFile ("{secondfile}")
strNextLine = objFile.Readline
Do Until objFile.AtEndOfStream
    strNextLine = objFile.Readline
    outfile.WriteLine(strNextLine)
Loop
objFile.Close
outfile.close

Then double click your .VBS file.

share|improve this answer

There is an editor, available either in Lite version or Professional version. This is EditPad pro from JGSoft. I registered it several years ago and kept registering the upgrades as well.

http://www.jgsoft.com.

JF

share|improve this answer

I've used Large Text File Viewer for reading huge server logs in the past. It doesn't require an install and is pretty simple to use.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.