How to move file from downloaded to the company's folder (have several different companies)

Hi all, I’m stuck to get the following done, hope to get help from any one of you :pray:

Background:
Download the excel files from website chrome for different companies a few times per week, move the files to folders that belongs to the companies respectively, so basically the files in that particular folder will continuously be updated.

Steps:

  1. When I download the new excel from the website, I need to get the previous updated excel file in that particular folder (?what activity should I use)
    2.Compare the current excel and the previous updated
  2. Extract the differences(new rows) to a new sheet/workbook

Should I move the file once downloaded instead of trying to download it all? If so, may I have an example how to move file to folder respectively (how to let it detect the company’s name and move it ?)

Hello @RPA_Innovation

You can download the file and use Move file activity to move the file to the respective company folder.

String.Join(“”,Directory.GetFiles(FolderPath,”*”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1))

This will help to get the latest file and you can use the logic in the below video to compare the 2 excels and to find the unmatched rows. Then you can write that to a new sheet.

Thanks

Hi, this video helps! but the code doesn’t
Except for the folder path, is there anything I need modify in that code?

FolderPath , you need to modify.

Thanks