1 Reply Latest reply on Dec 9, 2014 4:17 PM by philmodjunk

    Import Files as a Batch

    flamecoder

      Title

      Import Files as a Batch

      Post

      I have 14 differently named files with the data structure the same in each one. I will need to import them into the database weekly. It seems like a lot to import one at a time. Is there a way to import them all at once or loop thru the files to import their data?

        • 1. Re: Import Files as a Batch
          philmodjunk

          Import Records is a script step that can use a $Path variable to find the file to import. So in a loop, you can assign the $Path variable to a different value with each pass through the loop.

          You might assign the file names to a variable in a list: Set Variable [$Files ; value: List ( "file1" ; "file2" ; ...)]

          You can then use GetValue with a loop variable to loop through the file names to compute a file path where the file path text is the same except for the file name at the end.

          And with a system script or plug in, it's possible to get a list of all files in a folder. If you use a folder inside your Documents folder, you can even do this without any system script or plug in by using Get ( DocumentsPathListing ) and parsing out the list of files in a particular sub folder inside Documents.

          You may find this thread on $Path variables, container fields and the script steps that use them helpful: Exploring the use of a $Path Variable in Scripts