X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.cpp;h=df1a1c0615be21cd53ab51b0a82cfaab3871e847;hb=763d07b1c215b1bdc9d5d63431f78cfecc60acf5;hp=45d1176f9ddafeee56b219529efed45ea3d19d02;hpb=8c8acb6218f58f662466e4111ab8aa4da0caf93c;p=mothur.git diff --git a/mothurout.cpp b/mothurout.cpp index 45d1176..df1a1c0 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -1349,7 +1349,35 @@ int MothurOut::readNames(string namefile, map& nameMap) { exit(1); } } - +/**********************************************************************************************************************/ +int MothurOut::readNames(string namefile, map >& nameMap) { + try { + + //open input file + ifstream in; + openInputFile(namefile, in); + + while (!in.eof()) { + if (control_pressed) { break; } + + string firstCol, secondCol; + in >> firstCol >> secondCol; gobble(in); + + vector temp; + splitAtComma(secondCol, temp); + + nameMap[firstCol] = temp; + } + in.close(); + + return 0; + + } + catch(exception& e) { + errorOut(e, "MothurOut", "readNames"); + exit(1); + } +} /**********************************************************************************************************************/ map MothurOut::readNames(string namefile) { try {