Skip to main content
Question

Writing empty MapInfo-files

  • November 27, 2012
  • 4 replies
  • 16 views

hakans
Contributor
Forum|alt.badge.img+8
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

sigtill
Supporter
Forum|alt.badge.img+24
  • Supporter
  • November 27, 2012
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

hakans
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • November 27, 2012
Any other thoughts than scripting?

owen
Forum|alt.badge.img+1
  • November 27, 2012
You could try a creator transformer, set to 'create at end'. This could write out an empty record, hopefully overwriting the tables.

Forum|alt.badge.img
  • November 27, 2012
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


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