Guest User

Untitled

a guest
Oct 19th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. with open("file.csv", "r") as filestream:
  2. for line in filestream:
  3. currentline = line.split(",")
  4. cc = '0'+str("%0.3s" % currentline[0])
  5. group = '0'+str("%0.3s" % currentline[1])
  6. forecast = float(currentline[cmonth])
  7. if forecast > 0:
  8. try:
  9. print "Param: 0 CC: " + cc + " Group: " +group + " Year/Month: " + cdate + " Forecast: " + str(forecast)
  10. except Exception:
  11. print "Check the forecast value"
  12. cursor.execute("update dbo.orcam set Tx_Forecast=0, Vr_Forecast=? where Ccusto=? and Grupo=? and Anomes=?", forecast, cc, grupo, cdate)
  13. cursor.commit()
Add Comment
Please, Sign In to add comment