Read range activity for a column

hi every one, i have a excel file with me.which have “name” column.(names count not fix)I want to get all names ,which i will use in “for each row of data table”. so i want to know how should i read the table in “read range” in excel scope activity,and how i can get only names (not “end” and “total”) i think this will need linq query, then please help me to write linq query too.

image

@Hemant_Deshmukh

In read Range workbook “Range” field mention “A4” then it will read from that row.And add headers enable that option
Use filter datatable activity to filter end and total rows if it finds both rows then remove that rows

Hi @Hemant_Deshmukh

can you share the input please.

Regards

Book1.xlsx (8.1 KB)

@Hemant_Deshmukh

image

HI @Hemant_Deshmukh

please check below workflow and I have used the linq query for the result:

dt = dt.AsEnumerable().TakeWhile(Function(row) Not String.IsNullOrEmpty(row.Field(Of String)("name"))).CopyToDataTable()

Book1.xlsx (8.5 KB)
Sequence67.xaml (10.7 KB)

Hope it helps!!

Hey @Hemant_Deshmukh ,

Firstly lookup for the column name “name” in the sheet, after getting the cell address, use it to read excel

Later use linq to fetch rows until a blank row is Found

Below is the Linq

dt.AsEnumerable.TakeWhile(Function(x) Not x.ItemArray.All(Function(y) y.ToString = "")).CopyToDataTable

Below is the File
Get_All_Names From Excel.zip (10.0 KB)

Hope it Helps you out!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.