3 Replies Latest reply: Apr 20, 2017 8:29 AM by Kaushik Solanki RSS

    folder names

    souad ouertani

      Hello

      Can i Uses repetitive loop as for, while ... with folder names

      For example, I want to save the folder names of a path in array and then I loop on that variable

      i uses this script

      FOR Each vSubFolder in DirList(vBaseDirName)

         SET vSFolder = $(vSubFolder)\*;

      FOR Each vInnerFolder in DirList(vSFolder)

       

       

       

       

      folder:

      LOAD * INLINE [

      foldername

      $(vInnerFolder)

      ];

       

       

      NEXT vInnerFolder

      NEXT vSubFolder

        • Re: folder names
          Kaushik Solanki

          Hi,

           

          If I understand your requirement clearly, I feel you dont need to use the variable to do this. All you need is below script.

           

          sub DoDir (Root)

             for each Ext in 'qvw', 'qva', 'qvo', 'qvs', 'qvc', 'qvd'

                for each File in filelist (Root&'\*.' &Ext)

                   LOAD

                      '$(File)' as Name,

                      FileSize( '$(File)' ) as Size,

                      FileTime( '$(File)' ) as FileTime

                   autogenerate 1;

           

                next File

             next Ext

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

                call DoDir (Dir)

             next Dir

          end sub

          call DoDir ('C:')

           

          Regards,

          Kaushik Solanki

          • Re: folder names
            souad ouertani

            thank you kaushik So helpful script