split large file by string/regex
dieringe at zedat.fu-berlin.de
Mon Nov 22 21:54:34 CET 2004
William Park <opengeometry at yahoo.ca> writes:
> Martin Dieringer <dieringe at zedat.fu-berlin.de> wrote:
>> Jason Rennie <jrennie at csail.mit.edu> writes:
>> > On Mon, Nov 22, 2004 at 09:38:55AM +0100, Martin Dieringer wrote:
>> >> I am trying to split a file by a fixed string.
>> >> The file is too large to just read it into a string and split this.
>> >> I could probably use a lexer but there maybe anything more simple?
>> > If the pattern is contained within a single line, do something like this:
>> Hmm it's binary data, I can't tell how long lines would be. OTOH a
>> line would certainly contain the pattern as it has no \n in it... and
>> the lines probably wouldn't be too large for memory...
> man strings (-o option)
this doesn't make sense at all
More information about the Python-list