Fetch data from excel

Hello guys,

I am trying to fetch particular value from M column using read cell activity but it is not working
How to fetch particular value in M column irrespective of value position.
Thanks in advance

What error your are getting in Read Cell?

@asha_TN

1.Read the Excel into a Data Table Dt1
2.use assign activity filteredDt=Dt1.Select("[M column]=‘value’").copytoDatatable()
It will get the matched row into a new Dt

Regards,
A Manohar

Hi,
You can use read column activity to read a particular column, then you can filter that result value as you needed

Hi,

You can use Read Column activity or Read the entire excel using Read Range activity, iterate through the datatable using for each row then you can use if condition to filter or you can use
dt=originalDt.Select("[columnName]=‘value’").CopyToDataTable

thank you for your response guys,

can anyone send me sample code

thanks
Asha

i want to fetch the grand total amount.

in the below excel.
image

can u please help

i am converting unstructured data to structure data like this

and i want to fetch that 1296.35 amount.

@asha_TN Can you clarify if grand total cell will be same or changes ?

@asha_TN

use For each row
in if condition row(3).toString=“Grand Total:”
in Then use write line and print row(12)

OR you can use
get the count of rows from DT
Dt.rows.count
if it will be in M column itself every time
use read cell activity and keep M+count in range

regads,
A Manohar

it changes

Dear @asha_TN,

Can you share sample excel.

Hi,

Its very simple Just find the index of the Grand Total and Use Read Cell Activity and Provide range as M(Index-82) you will get the grand total value

Thanks Manohar,

image
i am getting red highlighter like this

@asha_TN

Are u getting Value?

Agency_Commission_Summary.xls (67.5 KB)
@sunil kindly check out

@manohar

No i am not getting

@asha_TN

check the count value what you are getting.
steps to follow
Use Excel Application Scope and declare the path of the Excel File.
Use Read Range and store it in Data Table dT1
use Assign Activity count datatype as int
count=Cint(dT1.Rows.count)
print the result if needed
use Read cell in Range maintain “M+count”

Regards,
A Manohar

in your cell selection you have something like
“M+counter”
but it should be like
“M” + counter.ToString

hope that helps

please find the below and try if this can help you

image

image