Avoid single character in for each loop

I am having a data table by using for each loop I am reading the columns

If a current row having single character or digit any avoid it using if condition.

Example

Names

Kiran
manu
2
Kumar
X
Mahi
Z

in current if i get 2, X,Z I need to Avoid.

Thanks in advance.

@ManjunathReddy

Build datatable

Read range the excel
Take for each loop
Name=CurrentRow(“YourName”).ToString
Str_Man=System.Text.RegularExpressions.Regex.Match(Name,“\w{2,}”).Value
Add Datarow

Write range

Hi @ManjunathReddy

Try this

For each Row in Data table
In If Condition give this

CurrentRow("Column").ToString.equals(“2”) or CurrentRow("Column").ToString.equals(“X”) or CurrentRow("Column").ToString.equals(“Z”)

I hope it helps!!

Hi @ManjunathReddy
Read Range (Excel/CSV) > Output: dataTable

For Each Row in dataTable
If System.Text.RegularExpressions.Regex.IsMatch(row(“Names”).ToString,“[1]$” )
Continue
End If
End For Each


  1. A-Za-z0-9 ↩︎

@ManjunathReddy

Use if condition and within if use the below syntax

item.ToString = "2" OR item.ToString = "x" OR item.ToString = "z"

Hope it works!!

Can I use this syntax without making any changes in it.

@ManjunathReddy
Yes,you can

Hi @ManjunathReddy

=> Use for each row in datatable activity to iterate the datatable.
=> Inside for each place If condition then write the below condition

CurrentRow("Names").ToString.Length>1

=> In then block give the activities to move forward.

Check the below image for better understanding.

Hope it helps!!

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