CsvLoadOptions Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
- Inherits
- Load
Options - Tabular
Load Options - Csv
Load Options
- Load
CSV import uses double-quote escaping and accepts CRLF, LF or CR record endings.
Syntax
public class CsvLoadOptions
Members
Constructors
| Constructor | Description |
|---|---|
| Constructor |
Properties
| Property | Description |
|---|---|
| DecimalSeparator | Decimal separator used by inference: period (default) or comma. Thousands separators are not inferred. |
| Delimiter | One non-quote, non-newline delimiter; defaults to comma. Semicolon and tab are supported. |
Examples
Import customer orders, configure bounded tabular exchange and export the processed values or a formatted workbook.
using TXTextControl.TXSheetControl.Server;
async Task<byte[]> ExchangeOrderDataAsync(ServerSheetControl control)
{
await control.LoadTextAsync("Customer;Amount\nMüller;125,5", StreamType.CSV, new CsvLoadOptions { SheetName = "Orders", InferTypes = true, MaxFileBytes = 1048576, MaxRows = 1000, MaxColumns = 20, MaxCells = 20000, Delimiter = ";", DecimalSeparator = "," });
var sheet=await control.Workbook.Sheets.AtAsync(0);
await sheet.Range("A1:B1").FormatAsync(new { bold=true });
return await control.SaveAsync(StreamType.SpreadsheetML);
}