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