7 Replies Latest reply: May 9, 2016 6:54 AM by Nihal Cakir RSS

    Load files from folder with exceptions

    Nihal Cakir

      Hi,

       

      I want to read all files from a folder, except one file (named AdType.qvd).

       

      First I used the following statement to make sure that loading all file works.

       

      set pathQVDs = '..\QVDsTest\';

       

      for each File in filelist(pathQVDs& '*.qvd')

        load * from [$(File)] (qvd);

      next File;

       

      ThenI tried to include an if condition so that all files except AdType.qvd are loaded.

       

      set pathQVDs = '..\QVDsTest\';

       

      for each File in filelist(pathQVDs& '*.qvd')

        if FileName('$(File)') <> 'AdType.qvd' then

        load * from [$(File)] (qvd);

          end if;

      next File;

       

      Still, ALL files are loaded (including AdType.qvd).

       

      I tested

      if FileSize(vFile) > 500000

      to make sure that the if clause is correct. It worked. So I assume that I do not state the FileName correct. I tried several things (I used FileBaseName, FilePath) but couldn't manage to get the syntax right.

       

      Any suggestions? Thanks!

       

      Nigel