6 Replies Latest reply: May 4, 2016 7:27 AM by Gabor Tarnoczai Branched from an earlier discussion. RSS

    Re: Load all tables from directory

    Sangram Reddy

      Hi Walter,


      Check this out:


      Set vConcatenate = ;

      sub ScanFolder(Root)

                for each FileExtension in 'csv'

                          for each FoundFile in filelist( Root & '\*.' & FileExtension)



                                    LOAD *, '$(FoundFile)' as SourceFile

                                    FROM [$(FoundFile)] (txt, codepage is 1252, embedded labels, delimiter is ',', msq, header is 2 lines);

                                    Set vConcatenate = Concatenate;

                          next FoundFile

                next FileExtension

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

                          call ScanFolder(SubDirectory)

                next SubDirectory

      end sub


      Call ScanFolder('C:\Users\hic\Documents\2012\Work\QV Apps\DoDir') ;


      loop through to load all files from a folder and its subfolders?#