1 Reply Latest reply on Apr 27, 2013 11:16 AM by GuyStevens

    Importing multiple files to related tables

    TxLukas

      Title

      Importing multiple files to related tables

      Post

            

                I'm trying to find a way to script the importation of comma delimited files to related tables. The file names include the date and a designation indicating which table they get imported to. For instance, I have three related tables:  Table_A, Table_B, Table_C. The files are generated daily with a filename "Alpha_mmdd.Ayy", "Alpha_mmdd.Byy", "Alpha_mmdd.Cyy" -  where mmdd and yy - are the date of the file - when they get imported, the file with "A" in the extension goes to Table_A, the file with B in the extension goes to Table_B, etc.

                The files are stored in a folder which accumulates previously imported files which should be ignored since the date in the filename defines the files of interest.

                So I guess my question is:

                Is there a way in Filemaker to create a filename as a string and pass it to the import command? The idea being that in addition to the Alpha_mmdd.Ayy file I also need to import "Beta_mmdd.Ayy" - however the import needs to be groups of three - that is all of the Alpha files for the specified date followed by the Beta files for the  same date.

                I'm out of ideas and would appreciate any and all suggestions.

            

        • 1. Re: Importing multiple files to related tables
          GuyStevens

               I'm sure you could create a variable that combines the current date and the "Alpha" in the correct format corresponding with the filename and then imports that file into filemaker.

               Create a variable like:

               "Alpha" & "_" & Month ( Get ( CurrentDate ) ) & Day ( Get ( CurrentDate ) ) & "A" & ( Right ( Year ( Get (CurrentDate)) ; 2 ) ) & ".csv"

               Will give you the following filename:

               Alpha_427A13.csv

               On 24 April 2013

               Combine that into a script and you should be able to create all the filenames you will want to import. The filename will change automatically according to the current date.