Skip to main content
Solved

.TAB rather than .tab

  • Jan 18, 2013 12:10 PM UTC
  • 6 replies
  • 89 views

ebygomm
Evangelist
Forum|alt.badge.img+54
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
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
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
  • Jan 18, 2013 1:17 PM UTC
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+22
  • Safer
  • Jan 18, 2013 1:39 PM UTC
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+25
  • Supporter
  • Jan 23, 2013 1:49 PM UTC
This FMEpedia article shows a shutdownscript that can be used: 

 

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

 


daveatsafe
Safer
Forum|alt.badge.img+24
  • Safer
  • Best Answer
  • Dec 15, 2015 11:44 PM UTC

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+26
  • Contributor
  • Dec 16, 2015 6:47 PM UTC

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+26
  • Contributor
  • Dec 16, 2015 7:03 PM UTC

Oops, Sorry.

I should have tested this before answering.

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