Select specific columns within .txt datatable and define column names

Hello I’m just starting with this tool and mi coding background is rather scarce so even I’m doing progress I struggle with some activities.
Im trying to capture data from a .txt file and then transform it according to some criteria.
So I use the activities read text file to create a variable which i then use in the activity “generate data table from text” to generate a second variable. And finally “Write DataTable to Excel”.
the txt. comes without headers and some of the columns it includes are not needed. So I tried using a template excel with the appropriate headers and append the write datatable, but didnt work at all, the process ends a I stay with the headers from the template but without the DataTable being appended.
If i dont append the datatable i get the table without the heades.

Is there any way of assigning headers to the DataTable before writing it to Excel and of writting only some of the datatable’s columns into excel?

Thanks in advance

At this result we would modify the columnNames
Assign Activity
dtVar.Columns(ColNameOrIndex).ColumnName = “NewName”

with the filter datatable we can also define removal / keeping DataColumns

Can you share with us?

Hi @diego.moral

As per my understanding you are not getting the headers in the Excel file so for that

In the Write DataTable Activity
You have to check on Add Headers