[PATCH] csv: add support for DBF-style column headers
|Reported by:||etourigny||Owned by:||etourigny|
|Cc:||Even Rouault, warmerdam|
I have created a patch for the csv driver to support dbf-style column headers, with the syntax used by openoffice/libreoffice.
This has the advantage over the .cvst format that only one file is needed for both description and data, and changes are easier to track in one file.
For example one csv file:
"INTCOL,N,5","REALCOL,F,10,7","INTCOL2,N","REALCOL2,F","STRINGCOL,C" 12, 5.7000000,,,foo
is the same as a csv file
INTCOL,REALCOL,INTCOL2,REALCOL2,STRINGCOL 12, 5.7000000,,,foo
and .csvt file
For now only Integer, Real and String are supported (Date was troublesome). Added creation option ADD_DBF_TYPES to output header with data types. On import the header is scanned for supported syntax in each column header and DBF header takes precedence over csvt file.
I haven't committed the patch to trunk, as I'm unsure if this needs an RFC. csvt support was implemented without RFC, so perhaps this can also follow the same route?
Attaching a patch with code and also an autotest and test file.