Extract excel data

Hi All,
I m a little stuck , i want to get all the data(data of all columns) for a particular row where there is a specific value in a column.I am able to get the value of a specific cell only.
Help will be appreciated.

Thanks in advance.
Rahul.

@Rahul_Dochak use for each row and pass the input.
inside use if condition as row(“name of the column”)=value
it goes to then section there you can give the write line row(0).to string+"-"row(1).tostring like you can mention to get the values of your datatable.

1 Like

First, read the excel file.
You would need to use Build Data Table to create an Empty Data Table, then Use For each row activity to traverse (loop) through DataTable, then use IF activity to check specific column in a row, if that value matches your criteria then use Invoke Method activity to import the specific Row to the new DataTable that you built

1 Like

Hi
–Hope these steps could help you resolve this
–use a excel application scope and pass the file path as input
–now use a read range activity and get the output with a variable of type datatable named outdt
–now use a for each row loop and pass the above variable
–inside the loop use a if condition like this
row(“yourcolumnname”).ToString.Contains(“that specific value”)
if the condition passes it will go to THEN part where we can get all the column values in that row using a assign acitivity like this
out_rowitemarray = outdt.Rows.IndexOf(row).ItemArray
where out_rowitemarray is a variable of type array of strings

Cheers @Rahul_Dochak

1 Like

ImportRow.zip (16.1 KB)

Here is an example

1 Like

Hi Rahul_Dochak
Please follow below steps,
1.Read excel and store into data table
2.User for each row and assign data table variable
3.In for each loop use assign activity i.e variable 1=row.item(“particular cell name”)

1 Like

Thanks all ,I will try these and let you all know if the problem persist.

1 Like

Great
Cheers @Rahul_Dochak

Hi Again @srdjan.suc,@Palaniyappan,@venkatmalla6 ,
It worked and I m able to get the data easily,but the thing is it is not optimized for a small sample it might work but if i have sample of thousands entries this will take forever,Is there a way to query it and not iterate it through.
Thanks .
Rahul

2 Likes

Yah sure
We can use a select method
Like this
Yourdatatable.Select(“[yourcolumnname] = ‘value to be checked’ “)
This will give us array of datarow

Cheers @Rahul_Dochak

3 Likes