I'm trying to use FeatureClassToFeatureClass_conversion() to convert tab files to shapefiles. When I run the code below, the error says
C:/temp1\Overlays\Character_Places\Historic_Misc_Heritage.TAB Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset C:/temp1\Overlays\Character_Places\Historic_Misc_Heritage.TAB does not exist or is not supported. Failed to execute (FeatureClassToFeatureClass).
import arcpy
from arcpy import env
import os
path = "C:/temp1"
for root, dirs, files in os.walk(path,topdown=False):
for file in files:
if file.endswith(".TAB"):
tabFile = os.path.join(root, file)
print(tabFile)
outLocation = "C:/temp3/results.gdb"
outFeatureClass = "shapefiles"
arcpy.FeatureClassToFeatureClass_conversio(tabFile,outLocation, outFeatureClass)
When I comment out the FeatureClassToFeatureClass code and print(tabFile) tabFile's contents are printed as..
C:/temp1\Overlays\Character_Places\Historic_Misc_Heritage.TAB
C:/temp1\Overlays\Character_Places\Identified_Places_Heritage.TAB
C:/temp1\Overlays\Character_Places\places_of_history.TAB
C:/temp1\Overlays\Character_Places\places_of_culture.TAB
etc
etc
I'm unsure why its saying the dataset doesn't exist and why tabFile isn't the correct input parameter for FeatureClassToFeatureClass() to work



inFeatures = "tabFile"should beinFeatures = tabFileor just usetabFileinstead ofinFeaturesfurther down. – PolyGeo Sep 12 '16 at 23:32filesis a list but in your codetabFilelooks like it is a*.tabfile. Please ensure that the messages (from errors and printing) you present are coming straight from the actual code snippet that you present. – PolyGeo Sep 13 '16 at 00:56TABfile - you can't just exportmydata.tab, you'd have to specify something likemydata.tab\mydata pointto output a point shapefile from point data in yourTABfile. – Midavalo Sep 13 '16 at 03:14path = r"C:\temp1"instead ofpath = "C:/temp1". You also seem to have an extra level of indentation on your firstforline and its code block – PolyGeo Sep 13 '16 at 04:02