HELP! How to check the name of the csv file list with the file name in the folder?

I am newbie. Please help me.Suppose I have a new.csv file and a folder like name is fileFolder and it,s in few file. Now need to check every row in new.csv file list match with file name. File name and row name is match then print something and again check for next row. Please upload the xml file.

1 Like

Hi @razu91
Fine
–use excel application scope and pass the file path as input
–get the output of the excel with read range activity and output of type datatable named outdt
–use a filter datatable activity and pass the input as outdt and get the output with a new datatable variable named final_dt created inthe variable panel and mention the default value for that datatable variable as new data.datatable in the variable panel.
then in filter datatable wizard, under column mention as “List” and condition as = and value as Nothing
–mark remove radio button in the filter wizard and click ok
–now the datatable will have filtered data without empty rows
–so use a assign activity next to this like
out_filepatharray = Directory.GetFiles(“yourfolderpath”,“*.xlsx”)
where out_filepatharray is a variable of type string array
–then use a for each row loop and pass the variable outdt as input
–inside this for each row loop use a for each row loop and pass the variable out_filepatharray as input and change the type argument as String in for each loop
–within this for each loop use a if condition like this
row(0).ToString.Trim.Equals(item)
if this condition passes it will go to the THEN part of if condition where we can use write line activity and print as “MATCHES”
or it will go to ELSE part where we can mention as “DOES NOT MATCHES” in write line activity

Thats all buddy you are don
Kindly try this and let know for any queries or clarification
Cheers @razu91

3 Likes

To continue with what @Palaniyappan says;

After that steps,

  • Take a For Each Row Activity.
  • In Properties provide Datatable as final_dt
  • In the Body of For Each take Path Exits activity.
  • Path Type as File and Path as the [Path of Folder]+item+[FileExtension]
  • This will give a Boolean value as whether the File exists or Not.
  • Based on the Boolean value using If condition you can do your further activity.
2 Likes

I’m newbie. Please can you upload in code like .xml.

1 Like

I’m newbie. Please can you upload in code like .xml. Its very helpful for me.

1 Like

Hello Palaniyappan,
Thanks for your help. According to your instruction I was completed code but showing error. Please check my code and resolve this. Please help me.
Thanks
Try.zip (7.6 KB)

1 Like

let me check once buddy
one min pls

Cheers @razu91

1 Like

Here you go buddy
Hope its resolved
Try (2).zip (17.3 KB)

Cheers @razu91

Palaniyappan,
Great bro, Thanks a lot. Go ahead in this way.

Hi Palaniyappan,
Hope you are well. Bro Can you help me for attached Flowchart. I believe I will get solution from you. Please upload the solution with xml file.
Image.zip (20.6 KB)
You can use my existing file for this.
Please upload the .xml file for this.

Thanks.

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