Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've written this script to import a csv file using ArcGIS' flavor of python.. ArcPy.. It seems to run fine up until the XYtoLine tool runs and then it fails..

This is the error message...

Traceback (most recent call last):
File "C:\temp\GIS_projects\Sample_tripData\", line 26, in <module>
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\", line 2913, in XYToLine
raise e
ExecuteError: ERROR 999999: Error executing function.
The table was not found. [tripLines]
Failed to execute (XYToLine).

this is the code I am running...

    # 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

    #delete old feature class
    if  arcpy.Exists("c:\\temp\\gis_projects\\sample_tripdata\\test.gdb\\tripLines"):
        arcpy.Delete_management ("c:\\temp\\gis_projects\\sample_tripdata\\test.gdb\\tripLines")

    #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..."

    # 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 =
    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:])
      row =

    del fc, input_table, row, cursor, out_lines, input_table, fields, xy_tol, z_tol, field

    print "Processing Complete!"

    print "ArcInfo license not available"
    sys.exit("ArcInfo license not available")

I've been over this a bunch of times and I still keep getting this error.. anyone have any ideas as to what is going on?

share|improve this question
Have you compared the format of your *.csv to that required by the tool help where it says "If you use text files and .csv (comma-separated value) files as input, make sure that they follow the file structure specified in About_tabular_data_sources"? – PolyGeo Jun 8 '13 at 0:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.