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

datatable
activities

#1

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?


#2

Hi @abhayk,

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

https://activities.uipath.com/v1.0/docs/datatable-output-data-table,

Regards,
Susana


#3

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


#4

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.