How does one write a data table to a text file?



I have created a data table.
Writing data to it in a loop.
Need to write the data table data to a text file.
The compiler complains that ‘System.Data.Data Table’ cannot be converted to a String.
Is there a way to get this done?


Hi @abhayk,

Have you tried OutputDataTable Activity? Writes a DataTable to a string using the CSV format.,



Besides above solution, i think you can use “Write CSV” with text file path (you get to choose comma and semicolon delimiters).


Thanks Susana and vvaidya for you suggestions.
I was initially trying the Write CSV option but it was not available then added it and now will be using that.