471,353 Members | 1,796 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Export ArcMap tables to csv

I'm brand new to python and somewhat familiar with ArcMap. I have a functioning script that produces a table using ZonalStaticticsAsTable_sa. I'm wondering how I can export that table using python to a csv so that it can be opened in excel. To do this manually with ArcMap or ArcCatalog would take way too long with the number of files. Any help would be greatly appreciated! I'm using Arc version 9.2 and Python version 2.4.1
Jul 18 '07 #1
3 5415
bvdet
2,851 Expert Mod 2GB
I'm brand new to python and somewhat familiar with ArcMap. I have a functioning script that produces a table using ZonalStaticticsAsTable_sa. I'm wondering how I can export that table using python to a csv so that it can be opened in excel. To do this manually with ArcMap or ArcCatalog would take way too long with the number of files. Any help would be greatly appreciated! I'm using Arc version 9.2 and Python version 2.4.1
Is this table stored in memory or an ascii text file? Can you show us what the data looks like?
Jul 18 '07 #2
Is this table stored in memory or an ascii text file? Can you show us what the data looks like?
When I go to the folder where the tables are saved, there is only an info folder. Within that folder, there are three files for each table: .dat, .nit and .xml. To view the tables, I must either go into ArcMap or ArcCatalog.

Here is the xml from one of the tables:

<?xml version="1.0" ?>
- <!-- <!DOCTYPE metadata SYSTEM "http://www.esri.com/metadata/esriprof80.dtd">
-->
- <metadata xml:lang="en">
- <Esri>
<MetaID>{00D5ABFD-2FB3-466B-91FE-AD4736D74A4F}</MetaID>
<CreaDate>20070709</CreaDate>
<CreaTime>12240200</CreaTime>
<SyncOnce>TRUE</SyncOnce>
- <DataProperties>
- <lineage>
<Process Name="ZonalStatisticsAsTable_2" ToolSource="C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\Spatial Analyst Tools.tbx\ZonalStatisticsAsTable" Date="20070709" Time="122402">ZonalStatisticsAsTable basin_plygn Name cp193010pre E:\drainage_basins\tables\193010bas DATA</Process>
</lineage>
</DataProperties>
</Esri>
</metadata>

I don't know if I answered your question. Thanks for the help.
Jul 18 '07 #3
bvdet
2,851 Expert Mod 2GB
When I go to the folder where the tables are saved, there is only an info folder. Within that folder, there are three files for each table: .dat, .nit and .xml. To view the tables, I must either go into ArcMap or ArcCatalog.

Here is the xml from one of the tables:

<?xml version="1.0" ?>
- <!-- <!DOCTYPE metadata SYSTEM "http://www.esri.com/metadata/esriprof80.dtd">
-->
- <metadata xml:lang="en">
- <Esri>
<MetaID>{00D5ABFD-2FB3-466B-91FE-AD4736D74A4F}</MetaID>
<CreaDate>20070709</CreaDate>
<CreaTime>12240200</CreaTime>
<SyncOnce>TRUE</SyncOnce>
- <DataProperties>
- <lineage>
<Process Name="ZonalStatisticsAsTable_2" ToolSource="C:\Program Files\ArcGIS\ArcToolbox\Toolboxes\Spatial Analyst Tools.tbx\ZonalStatisticsAsTable" Date="20070709" Time="122402">ZonalStatisticsAsTable basin_plygn Name cp193010pre E:\drainage_basins\tables\193010bas DATA</Process>
</lineage>
</DataProperties>
</Esri>
</metadata>

I don't know if I answered your question. Thanks for the help.
That answered my question, but unfortunately I cannot help because I am unfamiliar with ArcMap. Do you have a way of printing the tables? Could you print them to a text file?
Jul 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Shawn Mehaffie | last post: by
reply views Thread by Shawn Mehaffie | last post: by
3 posts views Thread by PSD | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.