out << thisNumFLows << endl;
files.push_back(outputFileName);
+ int numLinesWrote = 0;
for (int i = 0; i < largeSize; i++) {
if (in.eof()) { break; }
- string line = m->getline(in);
+ string line = m->getline(in); m->gobble(in);
out << line << endl;
+ numLinesWrote++;
}
out.close();
+
+ if (numLinesWrote == 0) { m->mothurRemove(outputFileName); files.pop_back(); }
count++;
}
in.close();
if (m->control_pressed) { for (int i = 0; i < files.size(); i++) { m->mothurRemove(files[i]); } files.clear(); }
+ m->mothurOut("\nDivided " + filename + " into " + toString(files.size()) + " files.\n\n");
+
return files;
}
catch(exception& e) {
m->mothurRemove(otuCountsFileName);
m->appendFiles(groupFileName, (thisOutputDir + m->getRootName(m->getSimpleName(theseFlowFileNames[0])) + "shhh.groups"));
m->mothurRemove(groupFileName);
- m->mothurRemove(theseFlowFileNames[g]);
}
+ m->mothurRemove(theseFlowFileNames[g]);
}
}
//otuCountsFile << base;
}
}
- otuCountsFile << newSeq.substr(4) << endl;
+
+ if (newSeq.length() >= 4) { otuCountsFile << newSeq.substr(4) << endl; }
+ else { otuCountsFile << "NNNN" << endl; }
}
otuCountsFile << endl;
}