[]
Gets the column index of the current cell.
public int Column { get; }
Public ReadOnly Property Column As Integer
CsvOpenOptions options = new CsvOpenOptions();
options.Parser = new LeadingZeroParser();
string filePath = Path.Combine(Path.GetTempPath(), "data.csv");
File.WriteAllText(filePath, "Code\n0012");
workbook.Open(filePath, options);
IWorksheet activeSheet = workbook.ActiveSheet;
class LeadingZeroParser : ICsvParser
{
public void Parse(CsvParseResult result, CsvParseContext context)
{
int column = context.Column;
if (column == 0 && context.Text.StartsWith("00"))
{
result.Value = context.Text;
}
}
}