Jump to content

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


Recommended Posts

  • 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

 

Link to post
Share on other sites

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.

 

  • Like 1
Link to post
Share on other sites

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.