X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.cpp;h=5a0ea1281b3644e1c0b42035054f9f7f2e0cf0f6;hb=1c898913f53fe4c6574102896b967d9347d1b42a;hp=3205ae794165a5b8c045c473403d8a66b1b54f90;hpb=a834131359fd7cf3625df70d7e77ca90a159e9fd;p=mothur.git diff --git a/mothurout.cpp b/mothurout.cpp index 3205ae7..5a0ea12 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -1229,6 +1229,33 @@ float MothurOut::ceilDist(float dist, int precision){ 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); + + nameMap[firstCol] = secondCol; + } + in.close(); + + return 0; + + } + catch(exception& e) { + errorOut(e, "MothurOut", "readNames"); + exit(1); + } +} + /**********************************************************************************************************************/ map MothurOut::readNames(string namefile) { try {