This tool can be used to export a shapefile's attribute table to a with a comma separated values (CSV) file. CSV files stores tabular data (numbers and text) in plain-text form such that each row is a record and each column a field. Fields are typically separated by commas. The user must specify the name of the shapefile (and associated attribute file), the name of the output CSV file, and whether or not to include the field names as a header column in the output CSV file.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
shapeFile = wd + "coutries.shp"
csvFile = wd + "countries.csv"
outputFieldNames = "True"
args = [shapeFile, csvFile, outputFieldNames]
pluginHost.runPlugin("MergeTables", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def shapeFile = wd + "coutries.shp"
def csvFile = wd + "countries.csv"
def outputFieldNames = "false"
String[] args = [shapeFile, csvFile, outputFieldNames]
pluginHost.runPlugin("MergeTables", args, False)