Hi…I have 2 excel workbooks(first excel workbook=template1 & second workbook=template2).
in template1 two sheets are der and in that columns are der like
in sheet 1
Sheet Name Age Address study
1 Charan 30 bangalore degree
1 ravi 25 hyd b-tech
AND IN SHEET 2
Sheet Name Age Address study
2 KIRAN 40 DELHI PG
2 KUMAR 50 MUMBAI PHD
i have to read them and copy them put them into template2 workbook in sheet 1…but columns are very ramdom like
Sheet Address study Name Age
1 bangalore degree Charan 30
1 hyd b-tech ravi 25
2 DELHI PG KIRAN 40
2 MUMBAI PHD KUMAR 50
shud append them like this can anyone please help me with this
for understanding purpose i provided two excel work books…from export excel data shud be pasted in test excel as per its column headers and shud be appended and amount shud be higher to lower please try to help me with this
Please make sure you have the same column name in all the sheet. However, you can have the order of the column in any manner you want. Please let me if i have resolved your issue
You are welcome @ ryava_santhoshi . You can use a array of sheet names and loop through the array. Basically. Define a main data table with exact table schema as your sheet tables . Read the sheet 1 and merge to the main dt. And repeat the process until all the sheet names are read in the array of sheet.
If you check InitAllSettings in RE Frame work you could see a similar approach for reading data from the sheet. But the only difference is der they are adding the data to a dictionary. So you could adopt the same approach by just changing it to a merge data table . Hope you are clear with my explanation?