X-Git-Url: https://git.donarmstrong.com/?p=mothur.git;a=blobdiff_plain;f=distancecommand.cpp;h=67ad7beb77b69d72f11914579246eb35dfa707e4;hp=0c9d011503370886d2f802d2903c72f985cbc40e;hb=163b300cfd7d4ca4e70c454be20f07b1d8346650;hpb=99bd02d78eaf21b01420c6f99e38efc7fa4e9e17 diff --git a/distancecommand.cpp b/distancecommand.cpp index 0c9d011..67ad7be 100644 --- a/distancecommand.cpp +++ b/distancecommand.cpp @@ -309,18 +309,12 @@ void DistanceCommand::appendFiles(string temp, string filename) { //open output file in append mode openOutputFileAppend(filename, output); - - //open temp file for reading openInputFile(temp, input); - string line; - //read input file and write to output file - while(input.eof() != true) { - getline(input, line); //getline removes the newline char - if (line != "") { - output << line << endl; // Appending back newline char - } - } + while(char c = input.get()){ + if(input.eof()) { break; } + else { output << c; } + } input.close(); output.close(); @@ -334,4 +328,4 @@ void DistanceCommand::appendFiles(string temp, string filename) { exit(1); } } -/**************************************************************************************************/ \ No newline at end of file +/**************************************************************************************************/