Fill Excel row with another row but different order

Hi,
i have two excels. If a certain condition is met i need to copy a row from the second excel to the first. The problem is that the second excel have different order. Also the first 3 columns must stay the same(In the first excel). I’ve tried to search for other question like this but i didn’t find something like i want to do.

1 Like

Hi @Mustafa_Hamed
what are the columns in first and second excel buddy
and how do they differ
Kindly elaborate that which could help us go in a right direction
Cheers @Mustafa_Hamed

1 Like

Hi,
all the columns in the second excel(the table below) have to go in the first excel(the table up). And i was saying the differ in order it’s like Column0(second excel) --> Column5(first excel)
Column2 --> Column8
Column3 -->Column10

and like that…

I forgot… i have to write a new row in the first excel under all the other rows, filling it with the data from the second table.

@Palaniyappan

1 Like

Ok Give me few mins buddy
Let me check once
Cheers @Mustafa_Hamed

Ok thanks @Palaniyappan

@Palaniyappan can you still help on this problem?

1 Like

difference in column and its count is some how the issue we are facing buddy
Fine
we can get the value from second excel file under the required columns like this
–use excel application and pass the file path of first file as input
–use read range and get the output with a variable of type datatable named dt1
–use another excel application scope and pass the file path of second file as input
–use read range and get the output with a variable of type datatable named dt2
–use a for each row loop and pass the dt2 as input and inside the loop
use a assign activity to get the value of the required column
like this
out_value1 = row(“yourcolumnname1”).ToString
out_value2 = row(“yourcolumnname2”).ToString

–still being inside the for each row loop use a add datarow activity and mention the above obtained values in the arrayrow property
–but how we mention matters, if we are clear with the order of the column where we want to enter the above obtained values then mention in the arrayrow property of add datarow without empty values in the place i.e., to the column where we dont have value to mention like this, suppose we dont have value for column3 then put “” means null value with the rest columns mentioned with the above variable as input
{out_value1,out_value2,""}

Kindly try this and let know for any queries or clarification
Do correct me if i have understood the query wrongly
Cheers @Mustafa_Hamed