Let me give you some general development advice that helps when a problem is overwhelming.
First of all, write down a list--an algorithm that you think will solve the problem. In your case try:
- for each file in treemap 1
- for each entry in that file
- for each line in the current file
- search for each term in the second treemap
- for each found term, replace with the definition.
Now, go into each one of those steps and enhance it. For the first one you should
- Iterate over the list of files in treemap 1
- open the next file
- start reading the contents
Do this for each step that you can't currently envision "Just Coding" until you can see just how you would do each step.
Once you are done with this, I suggest writing a Very Basic application that does one thing from your list--for instance, open a file. It's very helpful here to write a junit test or write a test in your main. Make sure that it opens the file and can read from it.
Once you are at this point, keep adding to your code--just add a little bit then recompile/retest. Retest every single line until you have coded for like 5 years, then go to every 2 or 3 lines.
Keep updating your tests to test your code. If you break an old test rewrite it, don't throw it away.
Iterate.
I hope this helps.