Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open("file.csv", "r") as filestream:
- for line in filestream:
- currentline = line.split(",")
- cc = '0'+str("%0.3s" % currentline[0])
- group = '0'+str("%0.3s" % currentline[1])
- forecast = float(currentline[cmonth])
- if forecast > 0:
- try:
- print "Param: 0 CC: " + cc + " Group: " +group + " Year/Month: " + cdate + " Forecast: " + str(forecast)
- except Exception:
- print "Check the forecast value"
- cursor.execute("update dbo.orcam set Tx_Forecast=0, Vr_Forecast=? where Ccusto=? and Grupo=? and Anomes=?", forecast, cc, grupo, cdate)
- cursor.commit()
Add Comment
Please, Sign In to add comment