For each file in a folder create an excel file

Please guide as to For each file in a folder create an excel file.

Kindly guide, I will truly appreciates/

@Rajat2,

Your question isn’t clear what you are trying to achieve. Explain it more in detail!

There will be 3 to 4 multiple PDF files saved in a file path and from there I am processing them one by one and when the data is being processed then i need to create excel files and paste the data in there.

Hope this helps

  • Get all PDF files from a folder
  • Use Directory.GetFiles("yourFolderPath", "*.pdf")
  • This returns an array of file paths.
  • Loop through each file
  • Use a For Each activity.
  • For Each pdfFile In pdfFiles
  • Read and extract data from each PDF
  • Depending on your process:
    • Use Read PDF Text / Read PDF with OCR (if it’s text-based)
    • Or use Document Understanding Framework (if structured like invoices, receipts, etc.)
  • Store extracted data in variables or a DataTable.
  • Create an Excel file for each PDF
  • Use Excel Application Scope
  • File name example:
Path.Combine("OutputFolderPath", Path.GetFileNameWithoutExtension(pdfFile) & ".xlsx")
  • This way, if your PDF is Invoice123.pdf, Excel becomes Invoice123.xlsx.

@Rajat2

  1. For each file in folder (give the location where pdf is present)
  2. inside loop use use excel file activity and it has an option to create file check it and in filname position give currentfile.Name.Replace("pdf","xlsx")
  3. inside that read the pdf as you need using read pdf activity and then can use write cell write range etc to write data to file

cheers

Use the For Each File in Folder activity to loop through the files. Inside it, read the current file (PDF) and create the Excel file.

I want for each pdf file one excel shall be created with 6 tabs sheet.

1 excel with 6 sheets with names like A, B ,C,D, etc

@Rajat2 first use excel process scope inside that use for each file inside for each file use “Use exce File activity” and enable the option create if not exist and in path provide the path of the pdf and replace “.pdf” with “.xlsx” after that use write range and provide the sheet name as pdf file name it will dynamically add the excel file and sheet in case if not present

@Rajat2

Then you need to have an excel as template with empty sheet or data already and then inside loop use excel file or write ramge or write cell

Give different sheetbames or use currentfile.bame as sheetnames

Cheers