How to Output DataTable to String Without the Table Header?



Hello, I’d like to write a datatable to a text file, and is using Output Data Table.
But I need to output it without the table header.
Is there any way to do it, or to go around it?

(I want to avoid using loop if possible, as the data now is very big).

The normal Output DataTable:
A1, B1
A2, B2”

Expected result:
“A1, B1
A2, B2”

Thank you in advance.


just type this in the log:

string.join(Environment.NewLine, yourDataTable.Rows.Cast(of DataRow).Select(function(row) string.Join(",",row.itemArray)))

If still appears add .skip(1) before .select

I wish it helps and dont hesitate to mark it as a solution if it works… :slight_smile:


@whyyouandi If you are reading from excel Read Range Actvity properties->check AddHeaders


Hello @NivedithaK, I found the solution already. Thank you!

Hi @indra, seems I was not making myself clear, I wanted to remove the header :wink:
But found the solution already, thank you !


Thank you @Ignacio_Insua_Feito, it worked well!
If anyone came across to this post in the future, please add one more ) so the code should be:
String.Join(Environment.NewLine, yourDataTable.Rows.Cast(of DataRow).Select(Function(row) String.Join(",",row.itemArray)))


editted :slight_smile:



string.Join(environment.NewLine,from m in testTable.Select select string.Join(",",m.ItemArray))
you can have a try.


Where exactly we need to type this in uipath?