MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / splitColumn

Method splitColumn

src/csvtable.cpp:838–852  ·  view source on GitHub ↗

* splitColumn */

Source from the content-addressed store, hash-verified

836 * splitColumn
837 */
838void CsvTable::splitColumn(table_index_t column, std::string splitStr) {
839 if( column < 0 || column >= getNumberCols() ) {
840 return;
841 }
842 addCol(column); // new column to the right
843 updateInternals();
844 size_t R = getNumberRows();
845 for( size_t row = 0; row < R; ++row ) {
846 std::vector<std::string> tokens = Helper::splitString(splitStr, getCell(row,column), 1);
847 setCell(tokens[0], row, column);
848 if( tokens.size() > 1 ) {
849 setCell(tokens[1], row, column+1);
850 }
851 }
852}
853
854
855/**

Callers 1

splitColMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected