public void appendWorkSheetColumns ( WorkSheet worksheet ) throws Exception { ArrayList < String > newColumns = worksheet . getColumns ( ) ; this . addColumns ( newColumns , "" ) ; ArrayList < String > rows = this . getRows ( ) ; for ( String row : rows ) { for ( String col : newColumns ) { if ( worksheet . isValidRow ( row ) ) { String value = worksheet . getCell ( row , col ) ; this . addCell ( row , col , value ) ; } } } }
Add columns from a second worksheet to be joined by common row . If the appended worksheet doesn t contain a row in the master worksheet then default value of is used . Rows in the appended worksheet not found in the master worksheet are not added .