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

Method mergeColumns

src/csvtable.cpp:859–870  ·  view source on GitHub ↗

* mergeColumns * Merges column `column` with `column+1`, using `mergeStr`. */

Source from the content-addressed store, hash-verified

857 * Merges column `column` with `column+1`, using `mergeStr`.
858 */
859void CsvTable::mergeColumns(const table_index_t column, std::string mergeStr) {
860 if( column < 0 || column >= getNumberCols() - 1 ) {
861 return;
862 }
863 size_t R = getNumberRows();
864 for( size_t row = 0; row < R; ++row ) {
865 std::string newCell = getCell(row,column) + mergeStr + getCell(row,column+1);
866 setCell(newCell, row, column);
867 }
868 delCols(column+1, column+1); // delete old column to the right
869 updateInternals();
870}
871
872
873

Callers 1

mergeColsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected