View Revisions: Issue #28582

Summary 0028582: CSV import into StringGrid omits first line
Revision 2015-08-28 22:49 by wp
Description As discussed in the forum (http://forum.lazarus.freepascal.org/index.php/topic,28932.msg181815.html#msg181815) the CSV import into a StringGrid fails to import the first data line if the parameter WithHeaders is false. See attached screenshot of the import of this data file:

1;Smith;Jim;Utah;111-111111
2;Adams;Joshua;New York;222-222222
3;Woodbridge;James;Alabama;333-333333
4;Woodgate;John;North Carolina;444-444444
5;Hamilton;Steven;Louisiana;555-555555

It is seen that the first line is missing in each of the two grid of this demo (the first grid uses predefined columns, while the second one does not).

The provided patch fixes this issue. In addition it takes care of cases when the data file contains text to be ignored above the import lines.
Revision 2015-08-28 22:44 by wp
Description As discussed in the forum (http://forum.lazarus.freepascal.org/index.php/topic,28932.msg181815.html#msg181815) the CSV import into a StringGrid fails to import the first data line if the parameter WithHeaders is false. See attached screenshot of the import of this data file

1;Smith;Jim;Utah;111-111111
2;Adams;Joshua;New York;222-222222
3;Woodbridge;James;Alabama;333-333333
4;Woodgate;John;North Carolina;444-444444
5;Hamilton;Steven;Louisiana;555-555555

It is clear that the first line is missing in each of the two grid of this demo (the first grid uses predefined columns, while the second grid does not).

The provided patch fixes this issue. In addition it takes care of cases when the data file contains text to be ignored above the import lines.