I agree, but OP was looking for the shortest path and that was the easiest I
could think of...
"Tom Serface" <tom@nospam.camaswood.com> ha scritto nel messaggio
news:83942DDE-14D4-49D4-960C-A0A9CC045B70@microsoft.com...
I would read the file with CStdioFile using CStdioFile::ReadString() for
each line.
I would parse with CTokenEx
I would write into a new file using a CString using CString::Format and
another CStdioFile using CStdioFile::WriteString().
Just use CStdioFile if you are only interested in English-only software.
As from a recent thread, I consider CStdioFile a buggy (from "bug") MFC
class in current (and past) implementations, with respect to Unicode
(which IMHO should be considered the default way of storing strings in
these days, be it UTF-16, or UTF-8, or others...).
Assuming that the OP is interested in CStdioFile-like classes, I would
suggest the OP to use some CStdioFile-done-well implementation like this:
http://www.codeproject.com/KB/files/stdiofileex.aspx
My 2 cents,
Giovanni