Using if condition if the file found then read the cell value and write it to output file in loop

i have an excel with file names, from that i have to look for an excel in directory and read desired cell value, then copy the cell value to the output folder.

i have reached to apoint were i am able to find the files then after if file found read the file copy a value and write it to an output file is something what i am not able to get.

Could anybody please help with this?

Hope these steps would help you resolve this
—use a excel application scope and pass the file path as input
—inside the scope use a read range activity and get the output with a variable of type datatable named dt
—then use a for each row activity and pass the variable dt as input
—inside the loop use a assign activity like this
Str_filepth = row(“yourcolumnname”).ToString
Where Str_filepath is a variable of type string
—Now use a READ RANGE activity from workbook activities
—in that mention as Str_filepath.ToString
And get the output with a variable of type datatable named dt1
-to get a specific value use a assign activity like this
str_output = dt1.Rows(rowindex)(columnindex)
Or use a for each row loop and pass dt1 and inside the use a assign activity and get the value we want
—then we can use Write cell activity from workbook activities where we can pass this str_outout as input and mention the file path as str_filepath

Kindly let know if any changes in process needed
Cheers @rahul_gola

Hi palaniyappan,

Thank you very much for the support.

I am trying but am stuck at Str_filepath = row(“Columnname”).ToString

Str_filepath variable is not yet declared in variable panel I guess
Cheers @rahul_gola

HI thank you,forgot to add variable, it is showing an error at the file path, i am sending you the file, could you please help i am just stuck here from morning!

Path_from_Excel2.xaml (14.1 KB)

the column name is not mentioned in assign activity
like row(“yourcolumnname”).ToString

cheers @rahul_gola

1 Like

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