String Manipulation in DataTable-Data cell

Hi Dears,

Need help please:-

using Re-Framework to build project, pulling excel data in to data table and using that in process transaction,
In below table I need to filter with DN, VS only. and get only those records.

Column1 Column2 Column3 Column4 Column5
124654 PEND s45452 DN VVS STD LTD VTL VS 05/21/2024
124654 sold s45452 DN VVS STD LTD VTL VS 05/21/2024
124654 sold s45452 DN VVS STD LTD VTL VS 05/21/2024
124654 sold s45450 DN VVS STD LTD VTL VS 05/21/2024
124654 sold s45452 DN VVS STD LTD VTL VS 05/20/2024
124654 sold s45451 DN VVS STD LTD VTL VS 05/21/2024
124654 sold s45458 DN VVS STD LTD VTL VS 05/21/2024
124654 sold s45452 DN VVS STD LTD VTL VS 05/19/2024

Thank you so much in advance !

Use the Filter Data Table activity and set it to keep rows where Column4 contains DN or Column4 contains VS.

1 Like

Hi Paul, Thank you so much for helping me on this one,
How do we specify multiple multiple strings with space in filter datatable?

HI,

How about the following sample?

arrDr = dt.AsEnumerable.Where(Function(r) System.Text.RegularExpressions.Regex.IsMatch(r("Column4").ToString,"\bDN\b") AndAlso System.Text.RegularExpressions.Regex.IsMatch(r("Column4").ToString,"\bVS\b")).ToArray()

Sample
Sample20240610-4.zip (3.2 KB)

Regards,

1 Like

You don’t specify multiple strings in one condition. You specify multiple conditions, and use the OR operator.

1 Like