Ok this code read the file but I had to insert an if statement in their or else the files near the end would not be written properly when I did a text file comparison to see if they were exact.
If I remove the if and the else statement, I get two additional lines and the last line of the original file doesn't get written, but the output file has two (or is it two less?) lines.
Code:
while (! myfile.eof() )
{
getline (myfile,line);
myfile3.open(stuff);
if(!myfile.eof())
{
myfile2 << line;
myfile2 << "\n";
}
else
myfile2 << line;