TStringGrid.LoadFromCsvFile can't handle multiline cells.
Original Reporter info from Mantis: Maris-S
-
Reporter name:
Original Reporter info from Mantis: Maris-S
- Reporter name:
Description:
TStringGrid.LoadFromCsvFile can't handle csv files which contains cells with multiline text ("Line1\r\nLine2").
Additional information:
Attached example program contains two string grids. First grid is filled with texts on form create, where 2nd column contains 2 lines text, separated with LineEnding. Row height is adjusted.
By pressing button "Save and Load" csv file is created in program current directory (file name multiline.csv), which contains 1St string grid results, after saving csv file is loaded into 2nd string grid with method LoadFromCsvFile.
Results in 2nd grid are mess. Each new line in cells goes to next row and leaves 2nd quote symbol.
Problem is because there is no check if new line symbol is between text delimiter symbols. Saving csv file works very good. Text delimiter symbols are placed where they are necessary, and opening file in any other software capable to deal with csv files, like Open/Libre office, works fine.
This bug makes method LoadFromCsvFile useless when csv file contains multiline values.
Mantis conversion info:
- Mantis ID: 27443
- OS: Windows
- OS Build: Windows 7 PRO
- Platform: Windows
- Version: 1.2.6
- Fixed in version: 1.5 (SVN)
- Fixed in revision: 48780 (#a95002e0)
- Target version: 1.6