Get all rows under specific keyword in Excel

Hi!

I have an excel sheet with lots of unstructured data. I want to save all the data under the keywords: art.nr, beskrivning, best.ant., á-pris etc (as in the picture). I am thinking if it is possible with the following logic: if all rows under keyword ‘beskrivning’ is not empty than extract the rows below it (and the corresponding values to its right and left). Does anyone know how to do this in uipath?

There is unstructured data before and after the screen shot I provided so hence I am trying to extract this specific part of the excel.

Thank you!

Hi @anorden,

Hope the keywords mentioned are the column headings and they are always in the fixed cell,
You can use read range activity to read the excel and store in the datatable. Then use the for each row activity to read each column heading and if condition to check whether the column ID is required or not. Then you can use the same range to copy the values under the column heading.

If it is not the column heading, you can loop through every row and you can find the values whatever you want

Hi @HareeshMR

Unfortunately the keywords don’t always begin in a fixed cell (and they are also not column headings), I guess it is not possible to use ‘Read Range’ from the cell containing the keywords?

If I loop through every row how do I extract all the rows beneath the keywords (as long as as the rows beneath keyword ‘beskrivning’ is not empty)?

If you find the variable whatever you want, (Assume the row index is 52 and the column index as 6) then

  1. Convert the column value to character using assign activity ==> Col = Convert.ToChar(columnIndex)

  2. GIve the range as ==> col +rowindex.ToString + “:” + col + dt.Rows.Count.ToString

Her Col is the column index, rowindex id the Row Index and dt is the datatable