@parkr4st wrote:
and if it is .sdf data?
The spreadsheet can be generated form either an sdf or shapefile.
Obviously the dbf file only exists for the shapefile, not for an sdf. You can easily pull out an Excel file that mimics a shapefile's dbf but can you pull one out from an sdf? The Reader's Digest answer is no because the sdf doesn't have a dbf file, however, that doesn't necessarily mean the sdf doesn't have easily extractable data, it just means the data has to be accessed in another way, from a different angle. This is the angle I came up with (I'm sure someone else can come up with an alternative).
Use MAPIMPORT to import the sdf as AutoCAD entities. Make sure to bring in the object data during this process.
Then use MAPDWGTOSDF command to export the drawing entities. At the beginning of that command, change Files of Type to ESRI Shapefile (*.shp). Unlike exporting to an sdf file where you can export any combination of points, lines and polygons, exporting to a shapefile is limited to only one type. You could conceivably run export-to-shapefile three times by running the procedure separately for points, lines and polygons. Once you've exported to shapefile you'll have a dbf that can be opened from Excel.
On a side note, I'd like to know why the OP needs, or wants, to pull out a csv with headers. Whatever the reason, there's probably a better way to do whatever he's trying to accomplish without jumping through all these hoops. The OP seems to be focusing on his workflow when his workflow may not be considered best practice.
Chicagolooper
