Skip to main content
Solved

.TAB rather than .tab

  • January 18, 2013
  • 6 replies
  • 21 views

ebygomm
Influencer
Forum|alt.badge.img+39
Does anyone know if it possible to get fme to write out tab files as .TAB rather than .tab

Best answer by daveatsafe

Link seem to be broken, but this Python in your Shutdown Script should do it:

import fme
import os
# get output folder from User Parameters
outFolder = fme.macroValues['DestDataset_MAPINFO']
# get list of files in folder
fileList = os.listdir(outFolder)
# loop through files
for file in fileList:
    # split name into root and extension
    root, ext = os.path.splitext(file)
    # rename to use lower case extension
    os.rename(os.path.join(outFolder, root + ext),os.path.join(outFolder, root + ext.upper()))
View original
Did this help you find an answer to your question?
<strong>This post is closed to further activity.</strong><br /> It may be a question with a best answer, an implemented idea, or just a post needing no comment.<br /> If you have a follow-up or related question, please <a href="https://community.safe.com/topic/new">post a new question or idea</a>.<br /> If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

davideagle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • January 18, 2013
It doesn't appear to be possible. By default both the MFAL and MITAB writers appear to create *.tab. Though the MFAL writer gets the closest by creating all uppercase file extensions, except for the .tab file which interestingly stays as lowercase.

 

 

You might be able to write a Python shutdown script to re-case the file extensions for you though.

 

 

If thats too tough though, this tool will allow you to UPPERCASE all your file extensions in a folder at the click of a button... it's not an FME approach but it gets your job done ;0)

 

 

http://www.bulkrenameutility.co.uk

 


fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • January 18, 2013
Optionally you can run a DOS rename command, this can also be added to the bat file (Batch deploy).

 

Hope this helps,

 

Itay

sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • January 23, 2013
This FMEpedia article shows a shutdownscript that can be used: 

 

http://fmepedia.safe.com/AnswersQuestionDetail?id=906a0000000ccVcAAI

 


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • December 15, 2015

Link seem to be broken, but this Python in your Shutdown Script should do it:

import fme
import os
# get output folder from User Parameters
outFolder = fme.macroValues['DestDataset_MAPINFO']
# get list of files in folder
fileList = os.listdir(outFolder)
# loop through files
for file in fileList:
    # split name into root and extension
    root, ext = os.path.splitext(file)
    # rename to use lower case extension
    os.rename(os.path.join(outFolder, root + ext),os.path.join(outFolder, root + ext.upper()))

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • December 16, 2015

Using the Dataset Fanout you can specify the extension. That might give you the opportunity to specify TAB instead of tab. You need to add an attribute containing the filename (without extension) on every feature.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • December 16, 2015

Oops, Sorry.

I should have tested this before answering.

This does not work as the Fanout creates a folder instead of files.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings