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