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.

Import multiple files types (XLXS, XML, CSV) automatically from multiple file paths. Plug-in required???

Featured Replies

  • Newbies

Hi All,

We're new to FM.  I tasked my team to write a transformation script to convert Excel files into a specific CSV Format .  

The script works well when run manually (user picks individual file) but fails miserably due to FM's apparent limitation when looking at folders, to only import image or text files.  For the project to be a success is must have the ability to:

  • Import multiple files types (XLXS, XML, CSV)
  • Import from separate file paths
  • Work on a schedule (e.g. every 15 minutes)
  • Run from sever (Win)

Nice to Haves:

  • Ability to import from FTP
  • Ability to export to FTP
  • Move files from source folder once imported

So can somebody point us in the right direction of an area of logic / functionality we should be exploring or a plug-in(s) we can take a look at.

(Note.  We're fully paid up on a yearly rental so have access to all versions...current still running 17)

Thanks in advance for any help given :)

David

 

You might want to take a look at the BaseElements plugin - specifically its BE_FileListFolder() function. It also has a function for uploading to FTP.

A similar functionality is available natively in FMP; you can use the Get(DocumentsPathListing) function to list the entire Documents folder, then filter this list to keep only files in a specified folder. And the Insert From URL script step supports ftp and ftps protocols.

Note that importing a folder of files is fundamentally different from importing a file: when you import a folder, each file is placed in a container field of a new record; when you import a file, you import the data in the file into your own fields and records. If your goal is to import the data contained in an Excel file and export it as .csv, you must import the file - and you can only import one file at a time. However, you can have your script get a list of the files to import (using one of the methods mentioned above) and loop over them, importing each in turn.

 

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.