3

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?

Ankur
  • 143

7 Answers7

5

Use the sed command:

sed 1d largefile > newfile
mv newfile largefile

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

dogbane
  • 4,746
3

See Most powerful Notepad / Text Editor replacement for Windows and Why.

Richard
  • 9,172
1

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.

pavium
  • 6,490
1

UltraEdit (commercial) handles large files rather well.

Nils
  • 155
1

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.

seanyboy
  • 1,695
0

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

jfmessier
  • 2,810
0

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.

Millhouse
  • 713