Changing an Existing .SHP File Table

Changing an Existing .SHP File Table

tturley1
Contributor Contributor
959 Views
4 Replies
Message 1 of 5

Changing an Existing .SHP File Table

tturley1
Contributor
Contributor

Can you add a new column of data (data set), an existing .SHP files data table?  If so how?

0 Likes
Accepted solutions (1)
960 Views
4 Replies
Replies (4)
Message 2 of 5

Pointdump
Consultant
Consultant

Hi Troy,
"Can you add a new column of data (data set), an existing .SHP files data table?"
In theory, select the Feature >> Edit Schema. That's what the Mapheads say to do, but I can't get it to work.
Here's another way. Bring in your Shapefile with MAPIMPORT. Use ADEDEFDATA to bring up the OD Table. There you can add another column of OD. Then MAPEXPORT. The only problem is that you'll need to hand-enter the data, so if you're looking to populate it with, say, Lat and Long or somesuch, I have no idea.
The easy way is to use QGIS. If you're interested in that route, post a Shapefile and what columns you'd like.
Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2027
0 Likes
Message 3 of 5

TerryDotson
Mentor
Mentor

The data fields in a Shapefile are stored in the .DBF (dbase III) file.  The rest of the Shapefile knows nothing about the fields it contains.  So if you have a capable dBase III editor or database tool, you can edit directly without doing anything graphical.

 

Be sure to make a backup copy of the .DBF file before saving any changes !!!

0 Likes
Message 4 of 5

drazen.galic
Collaborator
Collaborator
Accepted solution

Hi @tturley1,

 

I played a bit while ago with data in SHP, which are basically stored in DBF file (as @TerryDotson said). And I used MS Access, which has the both import and export to DBF format.

 

Regards,

Drazen

Message 5 of 5

tturley1
Contributor
Contributor

Hi Drazen,

 

I copied and renamed the .dbf file, opened it in Access as a .dbf file, edited the file adding one additional column, named it, populated the records with the data I wanted.  Then exported it out, renamed it back to the .dbf file name that was originally associated with the .shp file and it worked.  A long road indeed but it works.  He CAD Guru's can you incorporate a way to do this in C3D??

 

Thanks Drazen!