Merge catalog

A question about how to generate a directory using the xpp automation program, a book that includes the preface and the body, how to generate a directory between the preface and the body,
Or merge the separately generated directory between the preface and the directory of the main article (the page number between the preface and the directory needs to be obtained by the program)

For example

#system("$XyScript::XYV_EXECS/bin/divmerge -p5 DIV_catalog -cd C:/XPP/std_jobz/alljobz/CLS_book/GRP_book/JOB_book/DIV_test9");

-p5 is replaced by the program to get the title tag in DIV_test9 Page number