Select to view content in your preferred language

Auto DBF output help!

913
11
02-20-2014 09:11 AM
DannyLackey
Deactivated User
I'm not understanding how to use the script located here:
http://resources.arcgis.com/en/help/main/10.1/index.html#//00120000001t000000

I've used other python scripts such as auto pdf output script with no problem.  Here is how I'm attempting to use this:

import arcpy
from arcpy import env
 
env.workspace = "c:/Test"
 
inTables = ["AJD_rate"]
outLocation = "c:/Test"


try: 
    # Execute TableToDBASE
    arcpy.TableToDBASE_conversion(inTables, outLocation)
except:
    print arcpy.GetMessages()


The table I want to output to DBF is inside a .mxd file, but this script doesn't seem to require an input file, only a directory.  The table name is "AJD_rate".  Where am I going wrong? 

TIA
Tags (2)
0 Kudos
11 Replies
DannyLackey
Deactivated User
Here is the first thing I tried...

Opening a new instance of arcmap, clicking "add data", selecting a .xlsx spreadsheet with the x,y data, saving map (.mxd).  Then I run the python script...get errors.  I don't know how to reference the .mxd file or table within it. Seems like this should be easy...  I simply want to output the table I just added to arcmap (.mxd) (linked spreadsheet) to .dbf.
0 Kudos
DannyLackey
Deactivated User
Figured it out.

Using an mdb file created by ArcCatalog with the table in it I wanted converted to .dbf.  Python seems particular about having drive letters as opposed to complete network paths  (ie. \\)

import arcpy
from arcpy import env
env.workspace = "J:\DBF_Output.mdb"
arcpy.TableToDBASE_conversion(["Table_Name"], "J:\DBF_Output")

So simple it's dumb.
0 Kudos