How to create an excel file with a file directory?

Hi All
How to create an excel file with a file directory As an example?

there are several such folders


It needs to look like this as a result

I will be happy if you help me :slightly_smiling_face:

@Aibek_Abubakirov From where will we get the Values of Name and Gost Columns ?

  1. Build a Datatable with the column you have as in Excel
  2. Directory.GetFiles(“FilesPath”) will give you list of Files . Loop and get the FileNames .
  3. Add Datarow will help to add data in to DT. Add datarow value as a Array item . Increment the intCount
    Eg:- {LTD+intCount ,Path,Path1} .
  4. After loop ends write the DT to Excel.

Hope this helps you .

Its a mail directory Name i believe

@karthick Then the “LTD Name” is a Constant term that needs to be used?

These are the files that are in the folder.

In each folder, the names are different

@Aibek_Abubakirov Yes, I feel we can make the automation possible :sweat_smile: , Have you tried what @karthick suggested, that should work

LTD just wrote for example, folders of different names
Will it find the folder if there is another folder in it?

will he find the files in it?

@Aibek_AbubakirovI Is it possible for you to Show us How the Folders are located in your System ?

Inside folders

@Aibek_Abubakirov What’s inside of the Folder “essil town new”?

same files

@Aibek_Abubakirov But i couldn’t find the “LTD Name” folder :sweat_smile:


As per his excel sheet LTD Name is incrementing