0

I have a large number of MapInfo .TAB files which all need converting to ESRI Shapefiles. As far as I know, the Universal Translator tool within MapInfo is the simplest method to carry out this task. However, I'm also aware that this conversion will truncate all field names to a maximum of 10 characters. Unfortunately, I cannot bypass this limitation by using an alternative file type; ESRI Shapefile is our only option.

If I were to obtain a list of shortened field names in an Excel file (for example, wouldn't necessarily have to be Excel), would it be possible to import these (into either MapInfo or ArcMap) and overwrite the existing field names?

Bonus points for if this can be implemented into the conversion process. I'm trying to limit the amount of time I spend converting these files.

When using Universal Translator, I would select multiple .TAB files to convert at a time, so that I can let it run in the background while I work on something else; minimising the time actually spent on the task. It would be great if I could still do this, as opposed to selecting each .TAB file individually, and then selecting the respective file containing the list of field names.

  • What about using ogr2ogr rather than Universal Translator? It should allow you to batch convert your tab files to shape and I don't think it will truncate your field names. e.g. ogr2ogr -f "ESRI Shapefile" out.shp in.tab – T_Bacon Feb 20 '18 at 17:07
  • @T_Bacon surely it still would since the field name character length is 10 with shape? Nonetheless, I will try this tomorrow! – Cthulhu Feb 20 '18 at 17:44
  • Ah, sorry, I thought that might be a limitation of Universal Translator, not the shape file format. Is it really 10 characters?! Seems very limiting. As you can probably tell, I don't work with shape files much! – T_Bacon Feb 21 '18 at 12:57
1

Alternatively, you can write a small MapBasic application that loops thru your tables and renames each column to the shortened version.

Pseudo code:

For each tabFile:
   Open tabFile
   For each column in tabFile:
      index = Find columnName in listOfLongColumnNames
      If index > 0:
         Rename columnName to listofShortColumnNames[index]

You probably want to build one string to do the renaming of all the columns in one go as this would be faster - I asume - than renaming them one at a time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.