March 10, 200817 yr 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.
March 12, 200817 yr 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.
January 18, 200916 yr 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.
February 27, 200916 yr 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