Read multiple pdf file and write excel files based on pdf file name

hi,
i have multiple pdf files in my project like –
in input folder

  1. invoce_1.pdf,
  2. invoce_2.pdf,
  3. invoice3_pdf. …etc

after read pdf files i want to write excel files like based on pdf file name.

  1. invoice1.xlsx
  2. invoice2.xlsx
  3. invoice3.xlsx

but i am unable to write this logic

can any one help to me …

Hey @Anand_Designer
You can do that by using Directory.GetFiles(yourFilePath)
That will create an array of all the files in the directory, then you use a for each and extract the name of the pdf and create a new excel with that name.

Here is the example that does what you are looking for:
CreateExcelFilesBasedOnPDFNames.xaml (9.2 KB)

Cheers!

@ziga.hanzic i tried your work flow ,i did not get proper data in excel file.
i am getting all pdf data in one excel files mixing, and another is 2 pdf data, another is 1 pdf data.
every excel file should be one pdf data.(individually)
how to get like that.
invoice extraction.zip (1.1 MB)

Hey @Anand_Designer ,
You got almost everything correct in there, the only problem is, you are always writing the whole Datatable in the excel.
And every time you go through you add another row.

A simple fix is to just clear the Datatable Before you write the new row, using the Clear Data Table Activity.

Here I fixed it for you:
invoice extraction.zip (1.0 MB)

Hope this helps!
Cheers!

1 Like

Thanks for given solution @ziga.hanzic

1 Like

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