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.

Scripting import of multiple files in a folder

Featured Replies

Hi all. Is it possible to create a script to import multiple Excel files within a specific directory? All the files will contain the same fields and mapping. The catch is that the names and number of files may change.

Ideally i would like a script that can point to a location and will import each file in that location, regardless of their names or how many there are.

Thanks for any help.

you could with a plugin. (FileManipluator) or others

you would choose a folder or directory the plug-in would grab the path to that location

the plug-in could grab the file listings of that directory then with that data in a variable

you could process down the list of file that will import a directory of excel files.

  • 10 months later...

[Post deleted - I'll start a new thread]

Edited by Guest

Yes, you're missing something, and you've come very close to the answer, with this, "specify a variable as a parameter to execute an import".

The "variable" you need is a script Variable. It is a script step (in that top section). You set a script variable to the path (in FileMaker syntax) of the file, including the prefix needed: "file:" for relative path, "filewin:/" (or "filemac:/") for an absolute path.

A script variable's name starts with either "$" (local to script) or "$$" (global). You'd likely use $.

Once the variable is set you can use it directly in the file path dialog of the Import step. Use it straight, i.e., no quotes, ex., $filepath. (This also works in other path dialogs, Export, etc.).

But, seriously, with so much work needing to be done to the files, I would consider something like the Troi File plug-in (or other).* It is somewhat expensive, but it can do your substitutions in the file itself, before importing.

*On a Mac I would just use built-in shell commands, via AppleScript. I imagine Windows scripting experts could do the same.

  • 1 month later...

Speaking of Windows scripting...

I have multiple .csv files to be imported - the filenames are different each time.

I use this script to concatenate all .csv files into one "allorders.csv", and then import that.

cd DATABASESOrderDBOrderFiles

del allorders.csv

copy /y esellerate*.csv allorders.csv

The only problem is that the first row of the 2nd file is concatenated directly onto the last row of the 1st file (no CR break to make a new row).

I'd love to find a way to insert a CR in between the files. Any ideas?

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.