UpCur = gp.UpdateCursor(InFC)
row = UpCur.Next()
while row:
TimeList = row.Start_Time.split(":")
hr = TimeList[0]
row.setvalue("Hour", hr)
row = UpCur.next()
UpCur = gp.UpdateCursor(InFC)
row = UpCur.Next()
while row:
row.Hour = row.Start_Time.split(":")[0]
row = UpCur.next()input = "<table/feature class>"
rows = arcpy.SearchCursor(input)
for row in rows:
TimeList = row.Start_Time.split(":")
rows2 = arcpy.UpdateCursor(input)
for row2 in rows2:
row2.Hour = TimeList[0]
rows2.updateRow(row2)input = "<table/feature class>"
rows = arcpy.UpdateCursor(input)
for row in rows:
TimeList = row.Start_Time.split(":")
row.Hour = TimeList[0]
rows.updateRow(row)
del row, rows
row.Hour = int(row.Start_Time.split(":")[0])Here is the code I got to work at 10. You should be able to replace 'arcpy' with 'gp' and this should work at 9.3.
import arcgisscripting
import string
gp = arcgisscripting.create(9.3)
inFC = "C:\\Temp\\ESRI_Temp\\Development\\sk_TEST.shp"
rows = gp.UpdateCursor(inFC)
for row in rows:
TimeList = row.Start_Time.split(":")
row.Hour = TimeList[0]
rows.updateRow(row)
del row, rows
import arcgisscripting
gp = arcgisscripting.create(9.3)
input = "<shapefile>"
rows = gp.UpdateCursor(input)
row = rows.Next()
while row:
TimeList = row.Start_Time.split(":")
row.Hour = TimeList[0]
rows.UpdateRow(row)
row = rows.Next()
del row, rows
Try the following:import arcgisscripting gp = arcgisscripting.create(9.3) input = "<shapefile>" rows = gp.UpdateCursor(input) row = rows.Next() while row: TimeList = row.Start_Time.split(":") row.Hour = TimeList[0] rows.UpdateRow(row) row = rows.Next() del row, rows