sisu=open("dokmeta2.txt").readlines() tulbad=sisu[0].strip().split(',') f1=open("01b-textcontent.sql", "w") f2=open("01c-textproperties.sql", "w") for rida in sisu[1:]: jupid=rida.strip().split(',') f1.write("INSERT INTO core.text (id, content) VALUES('"+jupid[0]+"', '"+jupid[1]+" sisu')\n") for i in range(1, len(jupid)): if jupid[i]!="NA": f2.write("INSERT INTO core.text_property (text_id, property_name, property_value) VALUES ('"+jupid[0]+"', '"+tulbad[i]+"', '"+jupid[i]+"')\n") f1.close() f2.close()