for fc in arcpy.ListFeatureClasses(): outfc = fc + "_l" arcpy.PointsToLine_management(fc, outfc)
it comes up with the error "Output Feature Class: Same as input". Looks like it didn't convert at all, and added an "l" in the case of one file Bacon.shpl instead of what I want (Bacon_l.shp)
I am really bad with for loops and iterators, and I'd do this in ArcMap if I didn't have to manually enter a billion files using the batch feature.
It's probably because you're just appending "_l" to the feature class path , rather than inserting it. And when the feature class is a shapefile, you end up with
"filepath.shp" + "_l" which ==
import os.path import arcpy for fc in arcpy.ListFeatureClasses(): name, ext = os.path.splitext(fc) outfc = name + "_l" + ext arcpy.PointsToLine_management(fc, outfc)