How to Convert .txt file data to CSV /xlsx?

i have structured data available in a txt file, i want to move this data in to excel and then do the text to column process then aggregate.

I need help in converting this txt data in to Excel.
Text data image:
image

Expected Output :
image

1 Like

HI @smanik19
we have an activity called generate datatable activity ,
where we can pass the text, a string variable as input and get the output as datatable which can be written to a excel with write range activity
for more info on generate datatable activity

Cheers @smanik19

3 Likes

@Palaniyappan - This is working fine. Thanks

1 Like

Cheers @smanik19

This is giving result in the CSV. If i want to change the Headers or keep it pre defined titles is there any option is there ??

Fine
i hope your file has no header in it
so after generating a datatable if the property usecolumnheader is enabled, then a default column name will be entered to the columns
–if we want to enter our own column name, uncheck that property and create datatable first
–then use a invoke method activity to add a new row at the specific position lets say for us we need at the top right, put the in argument as 0 instead of 1

Cheers @smanik19

in Assign - Dt stand for what ??

Also please let me know what is the Variable Type you have choosen , is it Data Row ??

dt is the variable name that we have created which is of type DATATABLE
dr is the variable name that we have created which is of type DATAROW
Where dt.NewRow will create a datarow (dr) with the same schema of the datatable dt, means same structure of columns

invoke method uses dt.Rows
where Rows is a method of datatable dt, that represents the array of rows in the datatable whose collection of datarows is what datatable
and dt.Rows.InsertAt
where InsertAt is a method in Rows that is used to add the rows at specific position and this method takes two argument like this
dt.Rows.InsertAt(datarow to be added, position where we want to add)
so here
dt.Rows.InsertAt(dr,0)

Cheers @smanik19

1 Like

i am getting an error at Assign stating that the Data.Row can’t be converted as Data Table

image

in assign activity
left side mention as Dr not VarDTTab
as we are creating a datarow in the datatable VarDTTab

Cheers @smanik19

Sorry to bother you more…

this is the error now.

image

1 Like

No worries buddy
can i have a view on the parameters been passed to this invoke method
Cheers @smanik19

Kindly get the cursor to the blue mark and share that screenshot buddy
Cheers @smanik19

Fine can i have a view on the parameter property in invoke method,
Cheers @smanik19

image

Paramaeter are as Default value.There is no arguments enabled.

Well we need to pass the parameters buddy,
The error that occured now is due to some issue with parameter been passed
Thats why buddy
Cheers @smanik19

i set Argument as Data.Row but still error appears