This change permitted me to read cleanly through an ascii file x,y,v1,v2...v4018
and import each of the x,y,v combinations as 3D vector layers
independently (without attribute table)
This change permitted me to read cleanly through an ascii file x,y,v1,v2...v4018
and import each of the x,y,v combinations as 3D vector layers
independently (without attribute table)
If you have a need for many columns, it would be better to change it
to support any number of columns rather than simply increasing the
hard-coded limit to a larger value.
For a moderately-large number of columns, you'd need a version of
G_getl() which realloc()s its buffer as needed.
To cope with very large numbers of columns, the pull parser (reading a
line at a time) should be replaced by a push parser (reading
characters and pushing completed tokens into a state machine), e.g.:
for (; {
int c = fgetc(fp);
if (c == EOF) { /* end of file */ }
else if (c == '\n') { /* new record */ }
else if (c == separator) { /* new field */ }
else { /* append c to current field */ }
}