Hi folks,
I am wondering what type of exporter should I use to export tables (as standalonetable) to get file.txt
There is a lot of exporter to export into jpeg, tiff etc... and there is a possibility to select txt format in the Exportdialog. Unfortunately I do not find any solution to write a macro with VB to create a txt file of the attribute table ...
Cheers
and thank you
L.
The only example I have on hand at the moment will create a comma-delimited CSV/.txt file for an ADO.NET DataTable, but you could very well replace this with the rows in a standalone Table in ArcGIS.Anwyay, hope this helps!jamesuntestedDim CSVFile As System.IO.StreamWriter
CSVFile = New System.IO.StreamWriter("C:\FileNameToCreate.txt")
Dim sb As New System.Text.StringBuilder
sb = New System.Text.StringBuilder
CSVFile.WriteLine("Field1, Field2, Field3, Field4, Field5")
Using CSVFile
For Each r As DataRow In theADONetDataSet.Tables(0).Rows
sb = New System.Text.StringBuilder
sb.Append((r("Field1")) & "," _
& (r("Field2")) & "," _
& (r("Field3") & "," _
& (r("Field4")) & "," _
& (r("Field5"))))
CSVFile.WriteLine(sb.ToString)
Next
End Using