@Wayne, thanks.. I tried it both ways.. this time it ran through the process and executed the xytoline_management tool..I checked the env and it was correct this time.. thanks for the heads up.. :0)anyways, the tool ran and the csv was converted to lines.. but then it threw another error.. same as the first..here is the error message...Traceback (most recent call last):
File "C:\temp\GIS_projects\Sample_tripData\test.py", line 22, in <module>
arcpy.XYToLine_management(input_table,fc,"TSLONGDD","TSLATDD","TELONGDD","TELATDD","GEODESIC","TRIPSEQNUM")
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 2913, in XYToLine
raise e
ExecuteError: ERROR 999999: Error executing function.
The table was not found. [tripLines]
Failed to execute (XYToLine).
here is my new updated code...# Import system modules
import arcinfo
import arcpy
import sys
if arcpy.CheckProduct("ArcInfo") == "Available":
print "ArcInfo available, processing script..."
print "importing modules and set environment...."
#overwrite pre-existing files
arcpy.env.overwriteOutput = True
#set workspace
arcpy.env.workspace = "c:\\temp\\gis_projects\\sample_tripdata\\test.gdb"
fc = "tripLines"
# Set local variables
print "setting data input and output variables..."
input_table = "C:\\temp\\GIS_projects\\Sample_tripData\\A6_TEMP_ATL_TRIP_HAULx.csv"
#XY To Line
print "running XY to Line Geoprocessing tool..."
arcpy.XYToLine_management(input_table,fc,"TSLONGDD","TSLATDD","TELONGDD","TELATDD","GEODESIC","TRIPSEQNUM")
# Process to delete identical line features...
# Set the field upon which the identicals are found
fields = "Shape;TRIPSEQNUM;Shape_Length"
# Set the XY tolerance within which to identical records to be deleted
xy_tol = "0.0002 Miles"
# Set the Z tolerance to default
z_tol = "0"
print "Deleteing identical features..."
# Execute Delete Identical
arcpy.DeleteIdentical_management(fc, fields, xy_tol, z_tol)
print "Dropping leading character..."
cursor = arcpy.UpdateCursor(fc)
field = "TRIPSEQNUM"
row = cursor.next()
while row:
# set value of field to only those values after the zero value location
# I want to strip off the first character within the value of the field
row.setValue(field, row.getValue(field)[0:])
cursor.updateRow(row)
row = cursor.next()
del fc, input_table, row, cursor, out_lines, input_table, field
print "Processing Complete!"
else:
print "ArcInfo license not available"
sys.exit("ArcInfo license not available")