2 Replies Latest reply: Aug 23, 2017 8:46 AM by Staffan Johansson RSS

    For loop with date in filename

    Staffan Johansson

      Hi, I want to loop throug a folder With logfiles containing a date in filname.

      I want to start Reading With the file that have start date 2017-08-21 to 2017-08-27 (end date).

      The Variables contain correct date, problem is related to "for i", how should use "for i" here.

      Filename is ex Brd_2017-08-21.txt

      This is what I have done without success.

       

       

      Let vThisWeekStart = date(WeekStart(today(1)));
      Let vThisWeekEnd = date(WeekEnd(today(1)));

      for i = '$(vThisWeekStart)'to '$(vThisWeekEnd)';

      For each vFileName in Filelist ('\\1.1.1.1\folder\Brd_'& $(i) &'.txt')

        Table:
      LOAD
      *
      From $(vFileName)
      (
      txt, codepage is 1252, no labels, delimiter is '\t', msq)
      Next vFileName
      Next i