sql字符提取

作者:操作系统

python简单脚本-sql字符提取,python脚本-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+'",'

很简单,不解释

a= """ dr.GetStr("kh"), dr.GetStr("xm"), dr.GetStr("xh"), dr.GetStr("sfzh"), dr.GetStr("xbdm"), dr.GetStr("bjxx"), dr.GetStr("...

本文由金冠53777-金冠娱乐53777-Welcome发布,转载请注明来源

关键词: