Select to view content in your preferred language

Export comma delimited text file to dbf in VB dotnet

1114
2
10-16-2013 04:06 PM
scottvalentine
Deactivated User
Can a comma delimited text file be exported to a dbf file using IExportOperation.ExportTable Method? If so could someone point me to some sample code for the export?

Thanks
0 Kudos
2 Replies
HailiangShen
Deactivated User
Here is what i usually write .dbf file (corresponding to interface ITable)

1 create table in folder or geodatabase, refer to http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0049000000r4000000

2 write data into the table with ICursor, the operation is exactly the same as writing into featureclass if you are familiar with that operation except you do not need to write geometry for table

E.g. the following code will insert rows (from your csv file) into table

Dim cur as ICursor = tbl.Insert(true)
Dim buff as IRowBuffer
' loop your csv rows data 
    buff = tbl.CreateRowBuffer()
    buff.Value(index) = ...
    cur.InsertRow(buff)

cur.Flush()

0 Kudos
DuncanHornby
MVP Notable Contributor
An alternate approach is to call the existing Table to Table conversion tool using the geo-processor. If you have never called existing tools before then have a look at this page.

Duncan
0 Kudos