OPENING A FILE

Hello people!!

I have an excel DATA.xlsx (8.7 KB) where it has many columns, like

Where my requirement is to Concatenate every Name and Pan ID and add a “-” between them like “MANJEET-123456” and this string is a name of a pdf file in a particular folder.

I need to open every file that matches the Concatenation we done.

Thanks in advance!!!

Hi @Rakesh_Sampath

U can do this way

  1. Read the excel file and store in dt1

  2. Use for each row to loop through each row of dt1

Inside the for each row do the following:

Use assign activitiy to do the following

name= row(“NAME”).ToString.Trim+“-”+row(“PAN ID”).ToString.Trim

Then use path exist to check whether the path is existing

Like consider path as

C:\Users\output (folder in which PDF files are there)

Now use path exist activitiy to check whether the path is existing or not by providing input as

“C:\Users\output"+name+”.PDF"

and store the results of path Exist in a Boolean variable let’s say path_exist

Next use if Condition with condition as path_exist

If it is true , in then section do the following

a) Open the file

b) do the necessary actions
c) close the file after usage

If the condition is false ( ie file with Name-PanId is not there)

Then do accordingly in else section.

Hope it helps you

Mark it as solution if it resolves ur query

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

1 Like

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