I'm guessing that you update the data time and time again?
E.g. one tile changes and then you recreate the complete textfile?
I would create a class that caches all that data.
An interface between the physical file and the program logic.
So that you read/parse the big file only once and use the data where required.
Updating the data is then also done in memory and written to disk at a convenient moment, when absolutely necessary.
Or you could abandon the whole textfile idea and put all data into for example a SQLite db.
Gives you a lot of flexibility in storing the data in a more logical way and especially gives you the means to update only data that actually needs updating.
After you've finished the 'construction' you could generate a textfile from the SQL data to be used by your game engine.
Or you could use recordfiles so that you can use direct access to the data and update only the data that needs updating.
(Note that when this gets more elaborate you will quickly reach the point that a SQLite db might be worthwhile.)
<<edit>>
By the way: goto's??
