Convert Files – How to Convert a TAB (MapInfo) File to ESRI Shapefile with OGR2OGR

bashconvertogr2ogrshapefiletab

I want to convert a tab file created with MapInfo to an ESRI Shapefile (.shp) using ogr2ogr in command line.

I did the following

ogr2ogr -f 'ESRI Shapefile' "file.shp" "file.tab"

but it gives an error:

Unable to open datasource `file.tab' with the following drivers.

I use gdalv2.4

Do I have to specify anything else?

Best Answer

The following both commands should work with double quotes "" surrounding the file format "ESRI Shapefile" and with or without double quotes "" surrounding the files names:

ogr2ogr -f "ESRI Shapefile" "file.shp" "file.tab"

Or

ogr2ogr -f "ESRI Shapefile" file.shp file.tab

But using single quotes '' surrounding the file format 'ESRI Shapefile' will raise an error:

Unable to open datasource `file.shp' with the following drivers (in my case).