1 Reply Latest reply: May 23, 2013 1:00 PM by Gysbert Wassenaar RSS

    Concatenate Load all files in Folder

    Travis Russo

      Hello all,

       

      I took a lot of this script from user Henric Cronstrom. It's new to me and not surprisingly, I cannot figure out why it isn't working. I don't get errors in the script, the script runs and there is no data in the .qvw. I am sure the error is that it's not finding any files in the folder. The code is below. All the Files start with 'OM Holds' (no quotes) then have a date such as OM Holds 23May2013.xls. All the files are .xls.

       

      So the code should run through, find a file, load all the fields, then after the first run concatenate load.

       

      Thanks for any help you can provide1

       

      set vBaseDir = 'C:\OM_Holds\';

      set vFileBaseName = 'OM Holds';

      set vConcat = ;

       

      for each FileExtension in 'xls'

           for each vFile in filelist('$(vFileBaseName)' & '*.' & FileExtension)

              FileList:

              $(vConcat)

                load

       

                      *,'$(vFile)' as SourceFile

       

                from 

       

                     [$(vFile)] (biff, embedded labels, table is [Export Worksheet$]);

                    

                     set vConcat = Concatenate;

       

           next vFile

      next FileExtension