I get the feeling this is for work, so once again, just use perl or python and feed your reports through that before you submit them to the editor. I would learn C++ on your own time, because development time for even small utilities like the one you need now can be too long whereas in perl this might take like five minutes.