[EMAIL PROTECTED] wrote:
Input is this:
SET1_S_W CHAR(1) NOT NULL,
SET2_S_W CHAR(1) NOT NULL,
SET3_S_W CHAR(1) NOT NULL,
SET4_S_W CHAR(1) NOT NULL,
;
.py says:
import re, string, sys
s_ora = re.compile('.*S_W.*')
lines = open("y.sql").readlines()
for i in range(len(lines)):
try:
if s_ora.search(lin
<[EMAIL PROTECTED]> wrote:
> but output is:
>
> SET2_S_W CHAR(1) NOT NULL,
> SET4_S_W CHAR(1) NOT NULL,
>
> It should delete every, not every other!
for i in range(len(lines)):
try:
if s_ora.search(lines[i]): del lines[i]
except IndexError:
...
when you loop over a range,
wrote:
> Input is this:
>
> SET1_S_W CHAR(1) NOT NULL,
> SET2_S_W CHAR(1) NOT NULL,
> SET3_S_W CHAR(1) NOT NULL,
> SET4_S_W CHAR(1) NOT NULL,
> ;
>
> .py says:
>
> import re, string, sys
> s_ora = re.compile('.*S_W.*')
> lines = open("y.sql").readlines()
> for i in range(len(lines)):
> try:
>