Overwritting .shp files gives mixed results so my workaround is to delete the .shp file(s) first and then create the new version. But I can not figure out how to do that --I read somewhere that writers have a ‘delete’ setting for the ‘fme_db_operation’ parameter but I can not locate that anywhere. Can anybody tell me if FME has the ability to delete the .shp files in a folder? Thanks! Lewis
How to delete (shape)files from a folder
Best answer by bwn
Assuming Windows based system, with SystemCaller , use command line
Del “<shp_file_folder>\<shp_file_name>.* “
(with general use case assumption there will be no other unrelated files with a different extension by the same name)
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/del
You can retrieve and manipulate the list of files to target for deletion as 1 file per Feature with a File/Folder Reader, filter these with Eg. A Tester and pass each of the target shape files as input Features to SystemCaller to run the Del(ete) command line against.
The fme_db_operation attribute, typically output by a ChangeDetector, is not for file deletion. As implied in the name, it is a database operation on rows/records within a database table being written to, being INSERT, UPDATE, DELETE or UPSERT for where the use case is to only write delta changes to the database table rather than an alternative writing mode that completely drops, deletes all rows or truncates the table and fully rewrite it.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.