6 Replies Latest reply: Jul 26, 2012 1:57 PM by Oliver Demus RSS

    Load data out of variable locations

      Hi Community,

      I need to load data out of different locations. Here is what I have setup for this:

      // Set the current directory
      directory 'C:\Users\xyz\Desktop\';
      
      // folders to load
      set FolderScope = 'Folder1','Folder2','Folder3','Folder4','Folder5';
      
      FOR each FilePath in $(FolderScope);
      LOAD '$(FilePath)' & '\' & filename() as source,
      @1, @2,  @3,  @4 as @4,  @5,  @6, @7,  @8,  @9,  @10,  @11,  @12,   @13, @14,   @15,
      left(@8,4) as year,  mid(@8,5,2) as month,
      @2 & @3 & @4 & @5 & @6 & @7 & @8 & @9 & @10 & @11 as unikey
        FROM [$(FilePath)\*test*] (txt, codepage is 1252, no labels, delimiter is '|', msq);
      NEXT FilePath; 
      
      

       

      I would like to have the line:

      set FolderScope = 'Folder1','Folder2','Folder3','Folder4','Folder5';
      

       

      as a variable line. Ideally users could enter more folders in a file which would be loaded and the script is reading the folders out of that file.

       

      Any ideas how I could accomplish this?

       

      Thanks,

      Oliver