[gdal-dev] CSV file extension

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Thu Oct 25 02:31:00 PDT 2018


Andreas Oxenstierna wrote
> Can ogr read a csv file with another extension, like txt ?
> 
> I do not suceed


Hi,

>From the manual page https://www.gdal.org/drv_csv.html

"While in theory .csv files could have any extension, in order to
auto-recognise the format OGR only supports CSV files ending with the
extension ".csv". The datasource name may be either a single CSV file or
point to a directory. For a directory to be recognised as a .csv datasource
at least half the files in the directory need to have the extension .csv.
One layer (table) is produced from each .csv file accessed.

Starting with GDAL 1.8.0, for files structured as CSV, but not ending with
.CSV extension, the 'CSV:' prefix can be added before the filename to force
loading by the CSV driver."

Try ogrinfo CSV:my_text.txt


-Jukka Rahkonen-




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list