Maybe, opening the files with
ios::trunc
opening mode open would help.
ios::out implies ios::trunc when used with ofstream.
My problem was a plug-in setting I was using, as for the original problem. That lies within the FileFilter class and the getline loop.
OP: Just another point, you aren't capitalising A's and Z's :) Check your if statement again.