I would like a quicker way to export CSVs. Having to go to export table, then navigate out of the default gdb and into the default folder, then specifying the file type, is tedious.
I wish there were an "Export CSV" button under the Export Table button. Ideally the output would default to the default folder connection with the file type defaulting to .csv.
I've heard this complaint from a few people in my office so I figured I would post it here.
After exporting csvs I also get an unnecessary XML document which I would hope would be excluded if this were to be implemented as it creates clutter.
You could add a script tool to the Quick Access toolbar that has a table input and writes CSV to the project home folder.
@BruceHarold Thank you! That's a good work around.
In case anyone is interested, here is the code below. The only parameter is the input table that takes the data type Table View.
import arcpy
import os
# Get input table parameter
inputTable = arcpy.GetParameterAsText(0)
# Get the project home folder
homeFolder = arcpy.mp.ArcGISProject("CURRENT").homeFolder
# Create the output CSV file name
outputCSV = os.path.join(homeFolder, f"{os.path.basename(inputTable)}.csv")
# Export the table to CSV
arcpy.conversion.TableToTable(inputTable, homeFolder, os.path.basename(outputCSV))
# Construct the .csv.xml file path
outputCSVXML = f"{outputCSV}.xml"
# Delete the .csv.xml file if it exists
if os.path.exists(outputCSVXML):
os.remove(outputCSVXML)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.