Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to delete import file after processing records into FM13?

Featured Replies

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.

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.

  • Author

Thanks so much, the Export Field Contents worked perfectly.  I really appreciate the help, and I did update my profile. 

 

  • 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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.