I have a Excel sheet 1, i want to find start with A rows to store in sheet2.
Can you please suggest me
thank you
I have a Excel sheet 1, i want to find start with A rows to store in sheet2.
Can you please suggest me
thank you
share the input and expected output.
if you want to check for particular column use this
dt.asenumerable.where(function(r) r(“columnName”).tostring.startswith(“A”)).copytodatatble
to check all the row values use this
dt.asenumerable.where(function(r) r.itemarray.any(function(a) a.tostring.startswith(“A”))).copytodatatble
Did u try with Balareva excel activity from marketplace
Here is an activity called “Find”. it will return the cell info and row index as an array. So the last element is the last index.
Example:
Try this Linq
(
From row In DT
Let a = If(row("Column Name").tostring.startswith("A"),"Yes","No")
Select DT2.Rows.Add(row("Column Name"),a)
).copytodatatable
refer the above post or use the below query
dt.AsEnumerable.Where(Function(r) r(0).ToString.StartsWith(“A”)).CopyToDataTable
I have tried this linq query but getting some error
Try this
Code:
(From row In DT1.AsEnumerable()
Let name = row.Field(Of String)("ColumnName")
Where name.StartsWith("A", StringComparison.OrdinalIgnoreCase)
Select row).CopyToDataTable()
I/P:
O/P:
Hope this helps!!
can you share the error screenshot
with the sample input i have excuted
if you are copying and pasting the code you will get error,
if so please type the code and check once
@Dilli_Reddy
yeah its working thank you.
Thank for the reply @Shiva_Nikhil @lrtetala @Palaniyappan
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.