Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Add a row only to empty attribute tables

$
0
0
System ArcGIS 9.3
Python 2.6

Hello

Question 1
I have about 100 point shapefiles in a folder.
(Let’s call them type A shapefile)
All of them have no rows in attribute tables. (as attach python_1)Attachment 20162
I would like to add one row to each of them.
In the row, 0 (short integer) will be input in the field CXXXX. (X= number)

Please kindly help with the python code and thank you.

PS. Adding a row to an empty attribute table is to save the CXXXX field in the table.
The CXXXX field will remain after merging but won't without being input a row.

Question 2
In the same folder of the 100 point shapefiles,
There are about 50 point shapefiles in addition to type A shapefile.
(Let’s call them type B shapefile)
Type B shapefiles have one row in attribute tables. (as attach python_2)Attachment 20163

Please kindly advise how to modify the python code for Q1, in order to avoid adding a row to type B shapefiles. Thank you.
Attached Thumbnails
Click image for larger version

Name:	python_1.jpg‎
Views:	N/A
Size:	33.5 KB
ID:	20162   Click image for larger version

Name:	python_2.jpg‎
Views:	N/A
Size:	29.5 KB
ID:	20163  

Viewing all articles
Browse latest Browse all 2485

Trending Articles