Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How to delete import file after processing records into FM13?


This topic is 3689 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

After importing records from a .csv file into FM 13 Advanced, is there any way I can set the script to delete the .csv?

 

Here's my situation.  I am exporting data from an accounting system to a .csv file that "appends" with fresh data until the user decides to run an import script in FM13.  If the .csv file doesn't get deleted (or emptied of records) after the import into FM13, the accounting system export will just keep appending records into it and the import will be importing duplicate records into FM.

 

Any ideas or is this impossible to do via a script?  Thanks in advance.

Posted

Strictly speaking the answer is no, Filemaker cannot manipulate the OS file system.

 

However:

  • You can delete a file with a known path by exporting an empty found set using the same path. 
    Alternatively, use the Export Field Contents[] script step, but do not specify a field to export;
  • In your case, you could keep an empty .csv file in a container field and export that, overwriting the existing file;
  • Another option is to use OS-level scripting to delete the file;
  • Finally, there are several plugins that will allow you to access the OS-file system directly.

 

If the .csv file doesn't get deleted (or emptied of records) after the import into FM13, the accounting system export will just keep appending records into it and the import will be importing duplicate records into FM.

 

 

If the records contain some unique identifier, you should be able to prevent that.

 

--

P.S. Please update your profile to reflect your current version and OS.

Posted

 

  • Another option is to use OS-level scripting to delete the file;

 

To expand on that, it's fairly easy to to do for these simple file operation tasks.

 

On Mac you can use the Perform AppleScript script step or the Send Event script step to use a shell command.

On Windows you'd use the Send Event script step to issue the relevant command

This topic is 3689 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.