Here is a link http://code.kx.com/wiki/Contrib/CompactingHdbSym to help you get started. It will not solve your problem directly but you will get some ideas from this script.
Von: firstname.lastname@example.org [mailto:email@example.com] Im Auftrag von Isaac
Gesendet: Mittwoch, 6. Januar 2016 07:04
An: Kdb+ Personal Developers
Betreff: [personal kdb+] merge hdb
Is there a way to merge sym files, which are for hdb data. I have two hdb folders, they are same except the date.
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
Tel: +44 (0)28 3025 2242
Tel: +1 (212) 447 6700
Tel: +61 (0)2 9236 5700