Checking for same row in Excel

Hi everyone,

I made a workflow, which basicly should perform the following task.

  1. upload File1 and File2 in DT1 and DT2
  2. compile each row of DT1 and DT2 into a string. (rowstring1 and rowstring2 variable)
  3. compare the first row of File1 (rowstring1) with all rows of File2 (rowstring2)
  4. each time when the content is the same it should add +1 to T_sum variable
  5. continue with row number 2 of File1 compare it to all rows of File2 add +1 to T_sum. go to row number 3 of File 1 and so on…

some additional info: both files File1 and File2 have 60-70 rows which are filled. but the Excel list goes until 402 both in File1 and File2.

To my question: the result at the end is something like 109000 (rows with the same content). but at this current stage the result should be should be 60-70 rows with same content. why is it displaying this absurd result ?

even if it is counting all empty rows (empty rowstring variables) the result should be 402 max.

Second question would be: how can I exclude emty variables of rowstring1 and rowstring2. I tried in the condition of the first while loops “rowstring1.trim.length <> 0 Andalso rowstring2.trim.length <> 0”. and I also tried “rowstring1.equals(”“) = false Andalso rowstring2.equals(”“) = flase”. both methods don’t seem to work.

here is the file:
Main.xaml (12.2 KB)
thanks for your help!

P.S: sorry for uploading it here but there is apparently no ‘Rookies’ section anymore.

1 Like

@B.D

Once try to print the how many rows of data that files contains first and then check once.

      Int rowCount = DT1.Rows.Count
      Int rowCount1 = DT2.Rows.Count

rowcount1 = 401 and rowcount2 = 401. any idea ?

Can you share the sample screenshot of your excel and screenshot of your code ( I can’t download your workflow due to my system restrictions)?

hi thanks for your repply, here some sreenshots. let me know if you have further questions.

anyone ?

Check this one and try to make use of it,

https://go.uipath.com/component/compare-datatables