# Convert a tab (Mapinfo) file to ESRI Shapefile with ogr2ogr

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?

• did you try: ogr2ogr -f "ESRI Shapefile" file.shp file.tab i think the problem is because you are mixing " and '. the filenames don't need to be in quotes were as the file type option -f has to be. – zwnk Jun 26 at 17:24

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).

Not sure if you got this working but the easiest way is to use QGIS which is essentially a GUI for ogr2ogr. If you load in your .TAB file into QGIS you can right click in the layers panel and click

Export > Save Features As..

From here you can select a number of formats to save as.

Chris