]> git.donarmstrong.com Git - mothur.git/blobdiff - mothurout.cpp
added split.groups command
[mothur.git] / mothurout.cpp
index 1231700a42e03b3d733e27141762a6c1e5708f00..aab9945230f680e4ce106e4266ff66ba5ee7c34e 100644 (file)
@@ -1182,7 +1182,20 @@ void MothurOut::getNumSeqs(ifstream& file, int& numSeqs){
 //This function parses the estimator options and puts them in a vector
 void MothurOut::splitAtChar(string& estim, vector<string>& container, char symbol) {
        try {
-               string individual;
+               string individual = "";
+               int estimLength = estim.size();
+               for(int i=0;i<estimLength;i++){
+                       if(estim[i] == symbol){
+                               container.push_back(individual);
+                               individual = "";                                
+                       }
+                       else{
+                               individual += estim[i];
+                       }
+               }
+               container.push_back(individual);
+
+               /*
                
                while (estim.find_first_of(symbol) != -1) {
                        individual = estim.substr(0,estim.find_first_of(symbol));
@@ -1192,7 +1205,7 @@ void MothurOut::splitAtChar(string& estim, vector<string>& container, char symbo
                        }
                }
                //get last one
-               container.push_back(estim);
+               container.push_back(estim); */
        }
        catch(exception& e) {
                errorOut(e, "MothurOut", "splitAtChar");