I have got the following problem: I would like to access a row from a DBF table. I have tried to access it through SearchCursor, but I am not able to do it without knowing the field name. This is my code:
# Create SearchCursor rows = arcpy.SearchCursor("tabulka.gdb\zrazkove_uhrny") # Get names of all fields field_names =  sFields=arcpy.ListFields("tabulka.gdb\zrazkove_uhrny") for field in sFields: field_names.append(field.name) # Print all values of second row for row in rows: print row.field_names
This code works only if I know the name of a row which I don't. I don't even know the number of columns in the table. This code work only if I substitute
row.F2 (F2 is the name of the column).
My questions are:
- Is there a simpler way how to access values in DBF table?
- Is there a way how to access values in DBF table using SearchCursor and without knowing field (column) names?