Reading only selected from Excel

Suppose, I have more than a lakh of rows in an excel and I want to read the data. Will the robot be able to read such a large set of data?

If No, then what can be done to fetch only selected rows using some condition (say where a column value is greater than 600) ?

1 Like

@Pankit

Yes it will read data but it will take little bit of more time as it contains large Data.

If you want to read certain data then you have many ways like using Filter DataTable activity or Select Query or LINQ query etc…

  filterDT = inputDT.Select("[ColumnName] > '600'").CopyToDataTable

Where inputDT is your original input data.

inputDT here will be the data read from the Excel, right? What if I want to reduce time and get only selected data in inputDT?

@Pankit

you have to split the data and filter it based on your condition using Select Query or Filter DataTable and then merge it.

How can i Filter it before reading the excel? Without touching the excel?

1 Like

@Pankit

You have to use Excel Macros to do that.

Anything that can be done from the UiPath itself? Suppose th excel is downloaded from somewhere, I wouldnt be able to create and save macros in them.

Hi

yah ofcourse it can be read with EXCEL APPLICATION SCOPE and READ RANGE activity itself
once after getting the datatable from read range activity we can use FILTER DATATABLE activity to filter the data we want

and for this

yah we can do that with a common macro file
to get that done
open your excel manually and in that click on VIEW option and click on MACRO under which click on RECORD MACRO
–now do the sorting manually in the excel meanwhile that steps will be recorded in the background and will get converted into relevant VB Script
–once after performing the process of sorting in excel at the left bottom of the excel screen we can see a small black square box and on pressing that the macro recording will be stopped.

–now click again on MACRO and VIEW MACRO and EDIT option
–which will open the macro and copy that and paste it in a txt file
–now use a INVOKE VBA activity inside the EXCEL APPLICATION SCOPE and mention the filepath of that txt file as input and method name as well

now where the excel file is, if we have the macro ready and is read and applied to any excel with EXCEL APPLICATION SCOPE

Cheers @Pankit