I have multiple lines but only one is written to the csv file. What am I missing from an except of my code.
s = (fullpath + lyr_source) with open('TEST.csv', 'w') as writeexcel: a = csv.writer(writeexcel) for line in:a.writerow ([line])
I broke the code apart into 2 separate parts.
Part 1) Looped the mxds and successfully printed the feature classes
Part 2) Using Search Cursor works fine on a shapefile but not a feature class.
The problem is accessing a feature class in an sde environment is what I conclude. It cannot open the feature class.
I will keep testing why is this the case, I may need to recheck how I set path using sde feature classes and their connection, may need special set up .
First, there's a nice way of posting code in GeoNet.
As for your error, first make sure you're building your paths correctly and that the feature class you're after actually exists. Also, check that last line in the code. You want to write each row to the csv, not fields.