Re: Deleting lines from a file

2007-12-17 Thread Michael Bentley
On Dec 17, 2007, at 6:25 AM, Horacius ReX wrote: > and regardless of the speed, what do you think would be the best > method to do this ? The first thing I'd look into is reading the whole file into memory, making all the deletions, and finally writing it out. But you said the file is big,

Re: Deleting lines from a file

2007-12-17 Thread Vladimir Rusinov
On 12/17/07, Horacius ReX <[EMAIL PROTECTED]> wrote: > > and regardless of the speed, what do you think would be the best > method to do this ? > use sqlite -- Vladimir Rusinov GreenMice Solutions: IT-решения на базе Linux http://greenmice.info/ -- http://mail.python.org/mailman/listinfo/python

Re: Deleting lines from a file

2007-12-17 Thread Diez B. Roggisch
Horacius ReX wrote: > and regardless of the speed, what do you think would be the best > method to do this ? Without more information about the contents of the file and who's reading them, we can't say more. if the reader is not under your control & doesn't deal with deletion-marks or anything s

Re: Deleting lines from a file

2007-12-17 Thread Tim Chase
> I need to write a program which reads an external text file. Each time > it reads, then it needs to delete some lines, for instance from second > line to 55th line. The file is really big, so what do you think is the > fastest method to delete specific lines in a text file ? Generally, with file

Re: Deleting lines from a file

2007-12-17 Thread Horacius ReX
and regardless of the speed, what do you think would be the best method to do this ? Michael Bentley wrote: > On Dec 17, 2007, at 5:34 AM, Horacius ReX wrote: > > > I need to write a program which reads an external text file. Each time > > it reads, then it needs to delete some lines, for inst

Re: Deleting lines from a file

2007-12-17 Thread Michael Bentley
On Dec 17, 2007, at 5:34 AM, Horacius ReX wrote: > I need to write a program which reads an external text file. Each time > it reads, then it needs to delete some lines, for instance from second > line to 55th line. The file is really big, so what do you think is the > fastest method to delete sp

Re: Deleting lines from a file

2007-12-17 Thread Larry Bates
Horacius ReX wrote: > Hi, > > I need to write a program which reads an external text file. Each time > it reads, then it needs to delete some lines, for instance from second > line to 55th line. The file is really big, so what do you think is the > fastest method to delete specific lines in a text

Re: Deleting lines from a file

2007-12-17 Thread Diez B. Roggisch
Horacius ReX wrote: > Hi, > > I need to write a program which reads an external text file. Each time > it reads, then it needs to delete some lines, for instance from second > line to 55th line. The file is really big, so what do you think is the > fastest method to delete specific lines in a tex

Deleting lines from a file

2007-12-17 Thread Horacius ReX
Hi, I need to write a program which reads an external text file. Each time it reads, then it needs to delete some lines, for instance from second line to 55th line. The file is really big, so what do you think is the fastest method to delete specific lines in a text file ? Thanks -- http://mail