0 Replies Latest reply: Oct 20, 2014 7:14 AM by pavan Kumar RSS

    How to read all the files using file time

      Hi Friends,

       

      I am trying to load files only which are updated in this month using the code

      DirectoriesToScan:
      LOAD * INLINE [
      Dirspec
      D:\Project LAC Reconciliation UI\Data\OGIS
      ]
      ;

      SUB doDir (dir)
        FOR EACH file in filelist('$(dir)' &  '\*.txt')
         Files:
        LOAD
        '$(file)' as FilePath,
      FileSize('$(file)') as FileSize,
      FileTime('$(file)') as FileTime,
      if(FileTime( '$(file)' ) >= MonthStart(Today()), 1,'0') as FlagRead,
      subfield('$(file)', '.', -1) as FileExtension,
      subfield('$(file)', '\', -1) as FileName,
      subfield (subfield('$(file)', '\', -1),'.' ,1) as Name
        AUTOGENERATE 1
        ;
        NEXT
        FOR EACH subdir in dirlist( '$(dir)' & '\*' )
        CALL doDir('$(subdir)')
        NEXT
      END SUB
      SUB doRoot (root)
        FOR EACH subdir in dirlist( '$(root)' )
         CALL doDir('$(subdir)')
        NEXT
      END SUB
      FOR i = 0 to FieldValueCount('Dirspec')
        Call doRoot(FieldValue('Dirspec',$(i)));
      NEXT i
      let ft=peek('FlagRead');    
      let fn=peek('FileName');   
      trace ft=$(ft);
        if ($(ft)=1) then

      Load * from

      Load * from

       

      But its loading only few files, stop at when it reaches the Non-Updated file

      Thanks

      Pavan