How read data from column and write into another datatable row

Hi All,

Am struggling to write data into excel.
Please find the below image:

I read data in Column-B from Input file and write into output file.
There is multiple input files, i have to append one by one in the output file.

Kindly advise how to do this…

Thanks in advance
Muthu

Hello @muthu.m,

You can achieve this using ‘Merge Datatable’ activity. Read data from both the input files, pass on the Datatables to this acitivity to merge into one Datatable and then you can write the output Datatable in the output file.

Thanks for quick response.
Input file data format & Output file format are different. So how could i write data into the output file.

Thanks,
Muthu

Could you please elaborate this.

Hi,

If your output file is your only “constant” , i would do something like this

step 1 - read the output file template / create datatable w/ all the needed columns
step 2 - read file 1 to datatable1
step3 - for each row of datatable1 use activity assign (or multiple assign) to assign the columns to variables w/ column name
step4 - add dataRow with the array created by all the variables you need for your output_datatable

You could also skip the variables part in step3 and assign directly to the output datatable , but for starters try it like this.

Hi @muthu.m

There is faster way of doing it

It is case of similar to transposing of matrix ( as studied in mathematics )

Check this workflow
sample workflow.zip (40.7 KB)

I had used sample file
Input as
image

Output as

Hope this is required output u need

Mark it solution if it resolves your query

Regards
Nived N

Thanks Nived_Nambiar.
Let me try your code.

Regards,
Muthu

1 Like