The overworld map is contained in a map array. What's drawn to the screen is stored in a viewport array, which is only 16x11 tiles. When entering the cave, the viewport is loaded with data about drawing the cave rather than pulling data from the map array. In the function which updates this viewport during cave entrance, this is where you're wanting to put your file access.
If your text file is fairly small, I'd suggest loading it at the beginning of the cave rather than each and every time you enter a cave. That way you're not constantly reading from the harddrive.
Over the next several weeks, I will be writing an extensive tutorial about my zelda game. If you're planning to make a similar game based on my code, it might be a good idea to read it after it's released.