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?

1 Like

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.

I want to know as to how one can data scrape something which is in tabular format and print it in notepad.


Data scrapping gives you output as datatable so use outputdatatable activity to convert datatable to string.
Write text file activity to write string to text.

1 Like

The linked activities page is no longer there.