Reading from Excel File using ClosedXML

前端 未结 3 1922
后悔当初
后悔当初 2020-12-08 14:28

My Excel file is not in tabular data. I am trying to read from an excel file. I have sections within my excel file that are tabular.

I need to loop through rows 3 to

3条回答
  •  被撕碎了的回忆
    2020-12-08 15:14

    To access a row:

    var row = ws1.Row(3);
    

    To check if the row is empty:

    bool empty = row.IsEmpty();
    

    To access a cell (column) in a row:

    var cell = row.Cell(3);
    

    To get the value from a cell:

    object value = cell.Value;
    // or
    string value = cell.GetValue();
    

    For more information see the documentation.

提交回复
热议问题