9 Replies Latest reply: Nov 16, 2017 5:17 AM by aparna v RSS

    loop through folders and sub folders to load multiple excel files

    aparna v

      I am using the below code to loop through folder

       

      sub DoDir (Root)

         for each Ext in 'xslx'

            for each FoundFile in filelist (Root&'/*.' &Ext)

               FileList:

               LOAD

                  '$(FoundFile)' as FullPathName,

                  '$(Dir)' as FileDir,

                  right('$(Dir)', 8) as FileDate,

                  Subfield(Subfield('$(File)', '\', SubstringCount('$(File)', '\') + 1), '.', 1) as FileBase,

                  FileSize('$(FoundFile)') as  Size        

               autogenerate 1;

            next FoundFile

         next Ext

         for each Dir in dirlist (Root&'/*' )

            call DoDir (Dir)

         next Dir

      end sub

      call DoDir ('lib://path')

       

      I have created new data connection and named it as path.I tried it loading by giving relative path also.But no data is loaded and entire data model is empty.