dawenliu <[EMAIL PROTECTED]> wrote:
> Hi, I have a file with this content:
> xxx xx x xxx
> 1
> 0
> 0
> 0
> 1
> 1
> 0
> (many more 1's and 0's to follow)
> y yy yyy yy y yyy
>
> The x's and y's are FIXED and known words which I will ignore, such as
> "This is t
I've changed the code a little bit and works fine now:
inf = open('input.txt')
out = open('output.txt', 'w')
skips = [
'xxx xx x xxx',
'y yy yyy yy y yyy']
for line in inf:
flag = 0
for skip in skips:
if skip in line:
flag = 1
continue
i
Thanks Kent. The code looks reasonable, but the result is that, the
output file comes out identical as the input file, with all the
and remaining inside.
--
http://mail.python.org/mailman/listinfo/python-list
dawenliu wrote:
> Hi, I have a file with this content:
> xxx xx x xxx
> 1
> 0
> 0
> 0
> 1
> 1
> 0
> (many more 1's and 0's to follow)
> y yy yyy yy y yyy
>
> The x's and y's are FIXED and known words which I will ignore, such as
> "This is the start of the file"
dawenliu wrote:
> Hi, I have a file with this content:
> xxx xx x xxx
> 1
> 0
> 0
> 0
> 1
> 1
> 0
> (many more 1's and 0's to follow)
> y yy yyy yy y yyy
>
> The x's and y's are FIXED and known words which I will ignore, such as
> "This is the start of the file"
Hi, I have a file with this content:
xxx xx x xxx
1
0
0
0
1
1
0
(many more 1's and 0's to follow)
y yy yyy yy y yyy
The x's and y's are FIXED and known words which I will ignore, such as
"This is the start of the file" and "This is the end of the file". The
dig