Question

Writing empty MapInfo-files

  • 27 November 2012
  • 4 replies
  • 8 views

Badge +4
Every night I update a bunch of MapInfo Tab-files, using FME Desctop.

 

 

My Issue:

 

When no features enter the writer to a specific feature type, no update is made to that file. The old content remains.

 

No features to the writer, indicates that I need the resulting file to be empty, rather than containing yesterdays data.

 

 

The MapInfo write has no "Truncate first" option, witch would help me out here...

4 replies

Badge +21
You can add a shutdown python-script that checks if any features have been written. If no features have been written - then either delete the old output-file (or copy an empty "dummy-file" and rename it).

 

 

More information regarding shutdownscripts:

 

http://fmepedia.safe.com/articles/How_To/Startup-and-Shutdown-Python-and-TCL-Scripts
Badge +4
Any other thoughts than scripting?
Badge +1
You could try a creator transformer, set to 'create at end'. This could write out an empty record, hopefully overwriting the tables.
Badge
If this is a nightly task, I guess that you workspace is launched by a scheduled task. Maybe you can have a DOS command added o your task  who will delete all files from your output folder before launching your workspace. If you need the files to exist and be empty when there are no feature written, another option would be to have a set of empty file that your DOS command can copy over the existing ones before launching your workspace.

Reply