On Wed, 8 Dec 2004 15:11:55 +, Max Noel <[EMAIL PROTECTED]> wrote:
>
>
>
> On Dec 8, 2004, at 14:42, Jesse Noller wrote:
>
> > Hello,
> >
> > I'm trying to do some text processing with python on a farily large
> > text file (actually, XML, but I am handling it as plaintext as all I
> > need
> I'm trying to do this with the re module - the two tags looks like:
>
>
> ...
> a bunch of text (~1500 lines)
> ...
>
>
> I need to identify the first tag, and the second, and
unconditionally
> strip out everything in between those two tags, making it look like:
>
>
>
A very simp
I would use a loop with a flag to indicate whether you are in the block or not. If the tags
are always and on a line by themselves you don't need an re:
lines = []
appending = True
f = open('foobar.txt', 'r')
for line in f:
if appending:
lines.append(line)
if line.strip() == '':
On Dec 8, 2004, at 14:42, Jesse Noller wrote:
Hello,
I'm trying to do some text processing with python on a farily large
text file (actually, XML, but I am handling it as plaintext as all I
need to do is find/replace/move) and I am having problems with trying
to identify two lines in the text file,
Hello,
I'm trying to do some text processing with python on a farily large
text file (actually, XML, but I am handling it as plaintext as all I
need to do is find/replace/move) and I am having problems with trying
to identify two lines in the text file, and remove everything in
between those two l