Hello, I am looking for some assistance on a datatable process. I have a datatable, called dt_Table. dt_Table has hundreds of rows of data. I need to identify which rows in dt_Table contain a dt_String - “My String” - there will be about a dozen rows which contain the dt_String. Once i’ve idenfitied each instance of dt_String, i need to pull the entire row 1 ABOVE dt_String, and 3 rows BELOW dt_String. As an example:
(0) Data Table Pull
(1) Data1 Table1 Pull1
(2) My String Table2 Pull2
(3) Data2 Table3 Pull3
(4) Data3 Table4 Pull4
(5) Data4 Table5 Pull5
(6) Data5 Table6 Pull6
So I would need to pull the entire row (2) row, as well as (1), (3) (4) & (5)
Please help! thank you
Welcome to the forums
give a try on following
LHS: arrIndexes | Datatype Int32() - Integer Array
(From x in Enumerable.Range(0, dt_Table.Rows.Count)
we will get an array with all RowIndexes where the particular column value contains the searched String
LHS: idx | Int32
LHS: Result | List(Of DataRow)
Thank you Peter, I was able to translate this to my process. Much appreaciated.
Perfect. Just do your final testing and close the topic when it was working fine by marking the solving post as the solution.
Forum FAQ - How to mark a post as a solution - News / Tutorials - UiPath Community Forum
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.