I have a problem regarding merging .pdf files from different folders with the condition, that the five first characters in the filenames should match for the merging of the pdfs to happen?
So say that folder 1 contains:
Folder 2 contains:
How do I get the files to matching and then execute of the merging?
It would be extra good if the larger file always would be selected as the top one in the merged pdf. (The bigger file is always in folder 1)
Experienced users probably have an easy fix for this.
Thanks a lot in adavnce!
Hope the following sample helps you.
Sample20220125-1.zip (110.8 KB)
Thanks a lot for the help this far! I get an error in my dict = value formula.
Can you see what is wrong with my expression?
Thanks in advance!
It seems missing . (dot) just before ToArray.
Can you also compare the following expression with yours?
dt = filesInFolder1.ToDictionary(Function(f) f,Function(f) filesInFolder2.Where(Function(f2) System.IO.Path.GetFileName(f2).Substring(0,5)=System.IO.Path.GetFileName(f).Substring(0,5)).ToArray())
I added the dot before ToArray and checked if your expression match mine, which it did. Now it´s giving a new error. Could it be that my variable type setting could be wrong? I´ve tried to use “string” an String (String), but neither did work.
It should be
I attached the sample project as zip file in my first post. Can you also check it?
Sorry, missed that you sent a project file. I´ll have a look at that! Thanks a lot for all the help. I´ll get back when I get it to work or I encounter a new problem.
Best regards, Arthur
Everything is working now. Big big thanks to you!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.