I'm trying to combine multiple files into one final file. Each file has many entries within them, most with overlapping titles. I would like to merge content between both, under the title headings. Think of combining two dictionaries and it makes more sense. Entries for a single word can be found in both, but definitions differ slightly in each. Some entries exist in one and not the other, etc.
For example, I'd like to merge these two files to produce a single output file:
Entry 1 Green Trees Entry 3 Orange Fibers
Entry 1 Red Trees Entry 2 Spotted Zebras Entry 3 Blue Fibers
Entry 1 Green Trees Red Trees Entry 2 Spotted Zebras Entry 3 Orange Fibers Blue Fibers
Note that Entry 2 did not exist in File 1, but made it to the final product. Likewise, the content of each entry was merged anywhere the entry ID matches.
How can I accomplish this?
EDIT: The above is a simplified version for asking the question. Below is a sample of actual entries in the files.
The $$$00001 is the Entry title.
From File 1
$$$00001 <b><br>- Original: Α<b><br></b></b>- Transliteration: A<b><br></b></b>- Phonetic: al'-fah<b><br></b></b>-... $$$00002 <b><br>- Original: script<b><br></b></b>- Translitera...
From File 2
$$$00001 <b><br>α<b><br></b></b>a; indeclinable... $$$00002 <b><br>texts<b><br></b></b>A...