Example scripts for deleting Excel files prior to writing.
Article Number: 000002178 - Last Modified: May 3, 2012
There is no writer parameter on the Excel writer for dropping an excel file prior to writing to it. Consequently features are always being added to an existing file.. Here are the TCL and Python commands to delete the file first.
Description
The Excel writer does not yet have a setting which allows you to delete an existing file prior to writing to the file. This can be a problem as features are inserted into an existing file possibly resulting in duplicate records. The only way to get around this is to delete the file first either via a Startup script or by using a DOS command in a batch file. To use a TCL startup script enter the string
if { [file exists $FME_MacroValues(DestDataset_XLS_ADO_3)] == 1 } {
puts [concat Deleting $FME_MacroValues(DestDataset_XLS_ADO_3)]
file delete -force $FME_MacroValues(DestDataset_XLS_ADO_3)
} else {
puts [concat $FME_MacroValues(DestDataset_XLS_ADO_3) does not exist]
}
|
Suggested Similar Articles