That is not hard to do. First you need to read about file IO. Here is a good introductory article http://www.cplusplus.com/doc/tutorial/files/
Once you are learn how to do, you need to come up with your data storage format. May be this may help. I would write in each line, the x-coordinate, the y-coordinate and the text
10,10,Hello World<br />
10,20,Here I come<br />
10,30,What a Beauty....