1 Reply Latest reply: Oct 19, 2011 10:30 PM by Kiran Rokkam RSS

    masive load

      Hi everyone...  i would like to load n files which have same estructure but their extentions are differents... and also... the name of which sheet in excel can be named different.....

      how i can load in a masive load way?

       

      thanks...

       

      AE

        • Re: masive load

          You need to create a source table list first and then load can be triggered.

           

          SourcesLocation:

          LOAD * Inline [

          FileName,Source,Location,Sheet

          SalesContry.xls,xls,D:\Data\,Sales

          SalesCountry.csv,csv,D:\Data\,NA

          SalesCountries.xlx,xls,D:\Data\,Sales

          ];

           

          For i = 1 to NoOfRows('SourcesLocation')-1

            vFile = Peek('Location',$(i),'SourcesLocation')&'\'&Peek('FileName',$(i),'SourcesLocation');

            vType = Peek('Source',$(i),'SourcesLocation');

            vSheet = Peek('Sheet',$(i),'SourcesLocation');

           

            if $(vSheet) = 'xls' then

            SalesLoad:

            LOAD SalesMan,

                SalesDate,

                SalesValue

            FROM $(vFile)

            (ooxml, embedded labels, header is 0 lines, table is $(vSheet));

            ELSE

            SalesLoad:

            LOAD SalesMan,

                SalesDate,

                SalesValue

            FROM $(vFile)

            (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

            ENDIF

          next

           

          The If else conditions are based on load file types. You can add delimiter column to SourceLocation if that changes from sources.

           

          Regards,

          Kiran.