Note that the txt export option of Tiled is a format used by one specific engine. Copying that format might not be the best solution for your use-case.
I would recommend you to save your Tiled maps in the native TMX format and parse it with an XML parser like libXML. The JSON export is also an option, but I have never worked with any JSON library in C++, so I can't recommend you one.
Open source code which loads TMX maps with libXML2 can be found in the sourcecode of the client of the open source MMORPG The Mana World. By the way: The lead developer of Tiled is also participating in the development of TMW.
Full Disclosure: I used to be a developer of TMW myself and wrote a few lines of the code linked above.