How to check all row in one column

Hi, I’m new for UiPath and try to do a program that check the digit in excel and move file to folder.

The rule is, if all digit in each row equal to 8 digit, the excel file will move to correct folder, if one of the digit not equal to 8 digit it will move to wrong folder.

The problem is the program i try to do will only check the digit in the first row. How to check all row in the column?

Below are the program i try to do and the excel file i want to check.

Main.xaml (9.6 KB)
Book1.xlsx (8.2 KB)

@horo1016
Use a boolean variable (e.g. blEqual8)
Set blEqual8 = True before the For Each
In For Each:

  • if Length = 8 → Do Nothing
  • If Length <> 8 → Set blEqual8 = False, then Break
    After For Each, check value of blEqual8
  • If True → move to Correct folder
  • If false → move to Wrong folder
1 Like

Hi,

Hope the following another way helps you.

Regards,

1 Like

@Yoichi @Doanh both of yours solutian can be use. Thanks!! :smiley:

I still have a question is it possible to check two condition in same time?

The rule is, one is the 8 digit same like just now, another one is, if each row have a digit that have XX110/EXXX-XX will also send excel file to correct folder. (The X can be any number, but must have 110/E, and also the - )

Below is the example of excel file that will send to the correct folder.
Book1.xlsx (8.5 KB)

1 Like

Hi,

Can you use the following expression in the if condition?

CheckNumber.All(function(x) System.Text.RegularExpressions.Regex.IsMatch(x.toString(),"^.{8}$|110/E"))

Regards,

1 Like

Hi, @Yoichi
Is it possible to let the digit in X fixed ?

For example, XX110/EXXX-XX the number in first two X can not more than two digit, so if the number from 00 to 99 will be correct, if more than 99 will be wrong.

For the 3 X also the same, like XXX can not more than 3 digit, so will be 000 to 999, if more than 999 will be wrong.

The last two X also the same.

Hi,

Hope the following expression helps you.

CheckNumber.All(function(x) System.Text.RegularExpressions.Regex.IsMatch(x.toString(),"^.{8}$|^\d{2}110/E\d{3}-\d{2}$"))

Regards,

1 Like

Hi,

If my understanding is right, the following will work.

Sample20200403-1.zip (21.2 KB)

Can you try this?

Regards,

Hi, @Yoichi
The rule is, the program will read whole excel file, but only read for column B and S.
At first, the program will read the row in column B,
if the row don’t have a date(for example 03-Mar-20), then it will read the next row, if the row have a date (for example 03-Mar-20 ), then it will read for the same row in column S, and if column S is match for the 8 digit and the XX110/EXXX-XX, this excel file will send to the correct folder.

Below are the excel file that will send to correct folder.
sample time sheet.xlsx (263.9 KB)

@Yoichi
I using this excel file to run the program,the excel file should send to correct folder, but it send to the wrong folder.
sample time sheet.xlsx (263.9 KB)

Hi, @Yoichi
It’s been a while since I sent you the invoices that i need you help me. How’s that going? I’ll really appeciate if i could recieve your reply. Thanks! :smiley:

Hi,

Can you try the following sample?

Sample20200406-1.zip (505.3 KB)

Hope this helps you.

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.