I use ‘Read Range’ to get data from an excel sheet to a data table.
But what if the data are not always on the same location on the sheet?
For example: in cell A1 there is typed a text, then rows 2 and 3 are empty and the table starts on the fourth row.
I think of looking for a unique word ( like the name of a table column ) to get the exact location.
But what is the way to get there? Or other suggestions?
KR
Johan
Either This has to be standardised if it has to be read with excel activity
Or
You can set a wider range in read range activity and then remove the empty rows in datatable
Or
You can read with vb script and remove the empty rows
Cheers @TALLIEU_Johan
If the first table header is constant…and the table header is where the table starts then you can use find/replace activity to find the first table header and subsequently use the output in the read range activity
https://docs.uipath.com/activities/other/latest/productivity/find-replace-value-x
If the headers start at first and there are empty rows in between…then use read range and then use filter datatable activity to filter the datatable for blank rows
Hope this helps
Cheers
Have you tried with LookUp Range activity to get the First Row column header
Refer to this XAML file
16.10.2023_Forum_2.xaml (9.2 KB)
Regards
Gokul
Hello @TALLIEU_Johan
- Read Range (to get the entire sheet into a DataTable)
- For Each Row (in the DataTable)
- If (currentRow.Contains(“Column Name”)) // Replace with your unique identifier
- Calculate the starting row and column for data extraction
- Extract and process the data
Thanks & Cheers!!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.