+ }
+}
+
+/***********************************************************************/
+
+void ColumnFile::output(vector<double> data){
+ try {
+
+ if(counter != 0){
+ string inputBuffer;
+ inputBuffer = getline(inFile);
+
+ outFile << inputBuffer << '\t' << setprecision(6) << data[0] << setprecision(iters.length());
+ for (int i = 1; i< data.size(); i++) {
+ outFile << '\t' << data[i];
+ }
+ outFile << endl;
+ }
+ else{
+ outFile << setprecision(6) << data[0] << setprecision(iters.length());
+ for (int i = 1; i< data.size(); i++) {
+ outFile << '\t' << data[i];
+ }
+ outFile << endl;
+ }
+
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ColumnFile", "output");
+ exit(1);
+ }
+}
+
+/***********************************************************************/
+
+void ColumnFile::resetFile(){
+ try {
+ if(counter != 0){
+ outFile.close();
+ inFile.close();
+ }
+ else{
+ outFile.close();
+ }
+ counter = 1;
+
+ remove(inName.c_str());
+ renameOk = rename(outName.c_str(), inName.c_str());
+
+ //renameFile(outName, inName);
+
+ //checks to make sure user was able to rename and remove successfully
+ if ((renameOk != 0)) {
+ m->mothurOut("Unable to rename " + outName); m->mothurOutEndLine();
+ perror(" : ");
+ }
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ColumnFile", "resetFile");
+ exit(1);
+ }