File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,17 +58,19 @@ static void PrintLastEditedBy(ExcelWorkbook workbook, TextWriter output)
5858 static void PrintSheetContent ( ExcelWorksheet sheet , TextWriter output )
5959 {
6060 output . WriteLine ( "=================================" ) ;
61- output . WriteLine ( "Sheet: " + sheet . Name + "[ " + sheet . RowCount ( ) + " , " + sheet . ColumnCount ( ) + " ]") ;
61+ output . WriteLine ( $ "Sheet: { sheet . Name } [ { sheet . RowCount ( ) } , { sheet . ColumnCount ( ) } ]") ;
6262 output . WriteLine ( "=================================" ) ;
6363
6464 for ( int row = 1 ; row < sheet . RowCount ( ) + 1 ; row ++ )
6565 {
6666 for ( int column = 1 ; column < sheet . ColumnCount ( ) + 1 ; column ++ )
6767 {
6868 var cell = sheet . Cells [ row , column ] ;
69- if ( ! string . IsNullOrEmpty ( cell . Text ) )
69+ var cellText = cell . Text ;
70+ var cellFormula = cell . Formula ;
71+ if ( ! string . IsNullOrEmpty ( cellText ) || ! string . IsNullOrEmpty ( cellFormula ) )
7072 {
71- output . WriteLine ( " " + cell . Address + ": " + cell . Text ) ;
73+ output . WriteLine ( $ " { cell . Address } : { cellText } { cellFormula } " ) ;
7274 }
7375 }
7476 }
You can’t perform that action at this time.
0 commit comments