Python simple script-SQL character extraction, python script-SQL
a="""dr.GetStr("kh"), dr.GetStr("xm"), dr.GetStr("xh"), dr.GetStr("sfzh"), dr.GetStr("xbdm"), dr.GetStr("bjxx"), dr.GetStr("wyyzdm"), dr.GetStr("hkszd"), dr.GetStr("mzdm"), dr.GetStr("zzmmdm"), dr.GetStr("ykh"), dr.GetStr("kssj"), dr.GetStr("jssj"), dr.GetStr("ksh"), dr.GetStr("kldm") ); mydb.InsertXskcbj( dr.GetStr("kh"), dr.GetStr("kslxdm"), dr.GetStr("ksccdm"), dr.GetStr("ksxh"), dr.GetStr("nf"), dr.GetStr("qh"), dr.GetStr("xxdm"), dr.GetStr("bjxx"), dr.GetStr("hbxx") ); mydb.InsertCkxx( dr.GetStr("kh"), dr.GetStr("nf"), dr.GetStr("kslxdm"), dr.GetStr("ksccdm"), dr.GetStr("ksxh")"""b = a.splitlines()c = []for i in b: index = i.find('"') if index != -1: end = i.find('"',index + 1) r = i[index+1:end] if r in c: pass else: c.append(r)for i in c: print '"'+i+'",'
Simple, not explained