]> git.donarmstrong.com Git - mothur.git/blobdiff - mothurout.cpp
finished added bygroup processing of chimeras in chimera.slayer and chimera.uchime...
[mothur.git] / mothurout.cpp
index c80bff27e4ab69bf26d0fddaae534fe625f6df0b..45d1176f9ddafeee56b219529efed45ea3d19d02 100644 (file)
@@ -958,7 +958,7 @@ int MothurOut::openOutputFile(string fileName, ofstream& fileHandle){
 }
 
 /**************************************************************************************************/
-void MothurOut::appendFiles(string temp, string filename) {
+int MothurOut::appendFiles(string temp, string filename) {
        try{
                ofstream output;
                ifstream input;
@@ -968,15 +968,18 @@ void MothurOut::appendFiles(string temp, string filename) {
                int ableToOpen = openInputFile(temp, input, "no error");
                //int ableToOpen = openInputFile(temp, input);
                
+               int numLines = 0;
                if (ableToOpen == 0) { //you opened it
                        while(char c = input.get()){
                                if(input.eof())         {       break;                  }
-                               else                            {       output << c;    }
+                               else                            {       output << c;    if (c == '\n') {numLines++;} }
                        }
                        input.close();
                }
                
                output.close();
+               
+               return numLines;
        }
        catch(exception& e) {
                errorOut(e, "MothurOut", "appendFiles");