System ArcGIS 9.3
python 2.6
Hello
I am trying to add a row to about 100 point shapefiles in a folder.
When adding a row, I also want to key in a string S under the field "CXXXX."
Different shapefiles have different CXXXX fields, such as C0001, C0089, and C0100.
The field is string, starting with C and followed by four digits.
The python code is almost ready, except the part of "CXXXX."
Please kindly help and thank you.
python 2.6
Hello
I am trying to add a row to about 100 point shapefiles in a folder.
When adding a row, I also want to key in a string S under the field "CXXXX."
Different shapefiles have different CXXXX fields, such as C0001, C0089, and C0100.
The field is string, starting with C and followed by four digits.
The python code is almost ready, except the part of "CXXXX."
Please kindly help and thank you.
Code:
# Create the insert cursor and a new empty row
rowsNew = gp.InsertCursor("lyr")
rowNew = rowsNew.newRow()
# Populate attributes of new row
rowNew.setValue("C****", "S")
# Insert the new row into the shapefile
rowsNew.insertRow(rowNew)
# Clean up the cursor
del rowsNew