0
1
I have a directory with PDF files that looks like this:
2016_AAA_SomeRandomText1.pdf
2016_BBB_SomeRandomText1.pdf
2016_AAA_SomeRandomText2.pdf
2016_BBB_SomeRandomText2.pdf
2016_AAA_SomeRandomText3.pdf
2016_BBB_SomeRandomText3.pdf
etc...
Note: SomeRandomText changes but it is in pairs.
So, I want to go through the folder via Windows CLI with a FOR loop and generate a PDF file for each pair of SomeRandomText with PDFTK. So, the output will be like this:
2016_AAA_SomeRandomText1.pdf + 2016_BBB_SomeRandomText1.pdf = 2016_SomeRandomText1.pdf
2016_AAA_SomeRandomText2.pdf + 2016_BBB_SomeRandomText2.pdf = 2016_SomeRandomText2.pdf
2016_AAA_SomeRandomText3.pdf + 2016_BBB_SomeRandomText3.pdf = 2016_SomeRandomText3.pdf
etc...
Here is what I have so far (assuming I am working in C:\user\pdfs):
FOR /R %I IN (*.pdf) DO pdftk