4 Replies Latest reply: Dec 3, 2012 8:06 PM by Ezreen Sharifudin RSS

    For Loop to store all related files

      Hi. I am trying to run this statement for all the .txt files available in the directory. I tried using a For loop but it only picked up the 1st .txt file available in the directory. Appreciate help from you guys out there...




      for each Ext in 'txt'
      for each FileName in ('$(sPathResources)'&'\*.' &Ext)
      LOAD *
      FROM [$(FileName)]
      (txt, codepage is 1252, embedded labels, delimiter is spaces);
      STORE File INTO $(FileName).qvd (qvd);
      DROP Table File;
      NEXT FileName
      NEXT Ext


      p/s: sPathResources = path where files are stored.