I might do it something like this. I made a number of changes, in particular, no need to end the name with a dot, separate the items in the file so they are readable, don't use a for-loop to try to guess how many items are in the file, just read it until there is no more data. Also, no need to declare the stream separately before opening it, do it in one go.
Some of the changes were just in formatting the output which may be considered cosmetic and not important.
However in the C++ code itself, I tend to like a reasonable amount of whitespace around operators such as >> and << otherwise, the code merges into a single block and isn't so easy (at least for me) to read. I also usually prefer the newline character '\n' rather than endl unless there is some specific reason why the stream needs to be flushed.