PDF Automation_Merge

Hi friends,

I have a pdf files Named as CMCS23-091651A and CMCS23-091651B

I am able to join the above 2 separated Pdfs into a single PDF.

I have many files like this Named as below,

CMCS23-091705A
CMCS23-091705B
CMCS23-091713A
CMCS23-091713B
M23-01826
S23-23926

I would like to merge CMCS23-091705A and CMCS23-091705B , CMCS23-091713A and CMCS23-091713B into a single Pdf.

S23-23926 and M23-01826 I have to Skip. I would like to merge the PDf that contains CMCS23A and CMCS23B.

How to join this above pdf’s there is a difference between 2 pdf’s is A and B.

Kindly do the needful.

Thanks in Advance.

Happy Automation …

HI,

Can you try the following?

 dict = pdfFiles.GroupBy(Function(f) System.Text.RegularExpressions.Regex.Match(System.IO.Path.GetFileNameWithoutExtension(f),"^[A-Za-z]{4}\d{2}-\d{6}" ).Value).ToDictionary(Function(g) g.Key,Function(g) g.ToArray)

Sample
Sample20231212-1.zip (176.2 KB)

Regards,

1 Like

Hi Yoichi,

Thanks for the solution, Its works for me.

Happy Automation

1 Like

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