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").r eadlines()
for i in range(len(lines )):
try:
if s_ora.search(li nes[i]): del lines[i]
except IndexError:
open("z.sql","w ").writelines(l ines)
but output is:
SET2_S_W CHAR(1) NOT NULL,
SET4_S_W CHAR(1) NOT NULL,
;
It should delete every, not every other!
thx,
RasDJ
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").r eadlines()
for i in range(len(lines )):
try:
if s_ora.search(li nes[i]): del lines[i]
except IndexError:
open("z.sql","w ").writelines(l ines)
but output is:
SET2_S_W CHAR(1) NOT NULL,
SET4_S_W CHAR(1) NOT NULL,
;
It should delete every, not every other!
thx,
RasDJ
Comment