1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +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:
AnotherTest 2021-03-27 16:59:25 +04:30 committed by Andreas Kling
parent 102065a8a9
commit 894bfa30a2
3 changed files with 28 additions and 5 deletions

View file

@ -158,7 +158,7 @@ auto CSVImportDialogPage::make_reader() -> Optional<Reader::XSV>
quote_escape,
};
auto behaviours = Reader::default_behaviours();
auto behaviours = Reader::default_behaviours() | Reader::ParserBehaviour::Lenient;
if (should_read_headers)
behaviours = behaviours | Reader::ParserBehaviour::ReadHeaders;