Additional rows added in Excel while merging two files

Hi All,

@Rishi1 @Manjuts90 @Gabriel_Tatu @loginerror

I am working on a project where I extract certain product data from a pdf and store it in an excel and later use that product information to pull data from a website and the data captured from the website is stored in another excel.

In the end, I have used merge excel activity to consolidate all the product information in one excel but after merging the files an additional row is added between the headers and content of second excel file.

Attached here are the snapshots of the three excels. The first two here are merged to form the third excel. As you can see the third excel has an additional row between the headers and the data of 2nd excel.

Excel 1:

Excel 2:

Excel 3 (Additional row highlighted in red box):

I have also attached the pdf and xaml file of this project for your perusal. (I believe you will have to make the necessary changes in the workflow for it to run on your local machine)

Zalora Sample Invoice_Goodman Project.pdf (50.4 KB)

Solution_Goodman_POC.xaml (58.5 KB)

Can anybody help me diagnose the flaw?

@Tom1989 It is happening because of merge datatable activity, it’s not ur fault. Instead of merge datatable workaround you can use write range activities and set the starting range correctly for both the write range activities. For time being u can use that.

@Manjuts90 Is there any other alternative to the solution you mentioned. I don’t want to select the rows statically. I want it to be dynamic.

Also, what’s the use of merge Excel activity?

@Tom1989 Method which i have mentioned is dynamic only

expNew.xaml (14.3 KB)

@Manjuts90
what is 65 in this argument: Convert.ToChar(65+dt.Columns.Count)+“1” ?

@Tom1989 it is ASCII value for “A”

it does not merge the two file though. I tried running your code. I didn’t create the data table. I just used two write range activities and typed the argument you shred in the property field of the second activity.

Please advise.

@Tom1989 after reading the 2 excel files did u perform the operation. Are you getting any error?

@Manjuts90

No. I figured it out. It’s working now. Can you explain the login behind that argument?

@Tom1989 First write range will work normally when it comes to second write range starting point we have given like below.
"Convert.ToChar(65+dt.Columns.Count)+“1"”

In Ascii 65 means A, from column A datatable1 will be written (consider datatabe1 will have 4 coulmns), Till D column datatable1 values are occupied, so we are adding column count of datatable1 (i,e dt.Columns.Count) 4, it becomes 65+4=69. Convert.ToChar(69) gives “E” so it becomes “E1” From that starting point next datatable2 will be written.

1 Like

Oh cool! Thanks for the clarification.

1 Like