I have a folder with sunfolders full of PDF files. I need to combine them in a way such that will use the folder names as chapters and file names as sub-chapters. How can it be achieved? Standalone app is preferred. Although using something in Python or equivalent will work.
for x in *.pdf; do echo "\includepdf[pages={1}]{$x}" >> myla.tex; done