mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 16:37:47 +00:00
Spreadsheet: Make the CSV reader more lenient
This adds an option "Lenient" that makes the reader conform to what appears to be the norm in spreadsheet-land: - Treat missing values as empty ones - Update previously read rows if another row with more columns are seen afterwards
This commit is contained in:
parent
102065a8a9
commit
894bfa30a2
3 changed files with 28 additions and 5 deletions
|
@ -41,6 +41,10 @@ enum class ParserBehaviour : u32 {
|
|||
TrimLeadingFieldSpaces = ReadHeaders << 2,
|
||||
TrimTrailingFieldSpaces = ReadHeaders << 3,
|
||||
QuoteOnlyInFieldStart = ReadHeaders << 4,
|
||||
Lenient = ReadHeaders << 5, // This is the typical "spreadsheet import" behavior
|
||||
// Currently, it:
|
||||
// - fills in missing fields with empty values
|
||||
// - updates previous rows with extra columns
|
||||
};
|
||||
|
||||
ParserBehaviour operator&(ParserBehaviour left, ParserBehaviour right);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue