How do I read only one row from the excel sheet?

Hi,

I want to read only one row from excell sheet. and that too without the header
I want to do this for 5 excel files. (read only single row from these files)
Please be quick if possible.

Thanks and Regards,
hacky_wacky

1 Like

Hi @hacky_wacky,

use read range activity to get the data table.(MyDataTable)
use the below code to get first record alone.
MyDataTable=MyDataTable.AsEnumerable().Take(1).CopyToDataTable()

Regards,
Arivu

Hi @arivu96

Suppose I have a excel file with 5k rows. Instead of reading the whole file can I read only few rows? Is it possible with UiPath?

its possible you can assign the row range., but its hard to get multiple value, so better read all the value and filter it

You could use Read Range and read the excel sheet to a datatable say dt_Excel.

Then use an Assign activity : DataRow = dt_Excel.Select(“Id=‘3’”)
Use your own condition to identify the row.

DataRow would be variable of type : System.Data.DataRow , (an Array)
DataRow(0) would give you your row.

Thanks @arivu96 and @ebinsunny