4 Replies Latest reply: Jul 28, 2015 4:57 AM by Marcus Sommer RSS

    Store QVD data into CSV

    Manoj Kulkarni

      Hi,

       

      I need to store data from QVD into CSV. Using below query i could able to generate csv file, but how to split the file into multiple when we reach the row limit in CSV or in excel or in any format.

       

      If anybody has worked or have solution, let me know. It will be great help...

        • Re: Store QVD data into CSV
          Sasi Vardhan KV

          Hi,

           

          In general excel will have some limited number of rows, and so I dont think so if QVD having more number of records can export in CSV.

          • Re: Store QVD data into CSV
            Tresesco B

            Try like:

            tablename1:

            First 10000 Load * from <qvd>;

            Store tablename1 <tablename1>(txt,delimiter is ';')         // or use where clause like shown below

             

            tablename2:

            Load * from <qvd> where recno()>10000;

            Store tablename2 <tablename2>(txt,delimiter is ';')

            • Re: Store QVD data into CSV
              Marcus Sommer

              If you want to split the qvd you will need a load-loop over the qvd then the store-command itself had no option for limiting the store in any kind. The follwing routine isn't tested and might need some small syntax- and logical adjustments but in general the logic should work:

               

               

              let vQVDFile = 'D:\Folder\File.qvd';

              let vQVDRecordsTotal = QvdNoOfRecords( '$(vQVDFile)' );

              let vQVDRecords = 65532;

              let vLoadCounter = 0;

               

              for i = 1 to vQVDRecordsTotal step vQVDRecords

                   csvFile:

                   Load * From $(vQVDFile) (qvd) where recno() >= $(i) and recno() < $(i) + vQVDRecords;

                   let vLoadCounter = $(vLoadCounter) + 1

                   store csvFile into csvFile_$(vLoadCounter).csv (txt);

                   drop table csvFile;

              next

               

              - Marcus