41 Replies Latest reply: Jan 16, 2017 10:22 AM by Yeo Poh sai RSS

    How to modify my script , When i need change my raw data file name,I don't need to edit QV script ?

    Yeo Poh sai

      Hi All

      I got the script from Staffan , May i know how to modify the below script , so that when i change the raw data file name , i can change it at excel file , with out open and edit QVW file.

        set vFile1 = '$(vRAWPath)Q_Payment_KL';

        SET vFile2 = '$(vRAWPath)Q_Payment_Penang';

        SET vFile3 = '$(vRAWPath)Q_Payment_TID';

      Meaning the above script need to change. so that it will refer to XLS file for file name..  

      Hope some one can share with me how to do it ?

       

       

      Thank.

       

       

      SET vDevelopment = 30;

       

       

      IF $(vDevelopment) = 0 THEN

       

       

      ELSEIF $(vDevelopment) = 30 THEN

       

       

        SET vRAWPath = 'C:\TEST\'; //local folder

      //==============Hardcodedlist====================

        LET vNoOfFiles=3;

        set vFile1 = '$(vRAWPath)Q_Payment_KL';

        SET vFile2 = '$(vRAWPath)Q_Payment_Penang';

        SET vFile3 = '$(vRAWPath)Q_Payment_TID';

      //============================================

        else

       

       

      END IF

      for i =1 to vNoOfFiles

      For each vFileName in FileList('$(vRAWPath)*.txt')

      if(subfield('$(vFileName)','.',1) = '$(vFile$(i))') then

      ARSummary:

      LOAD left(FileBaseName(), 4) AS Report5_pay,

        FileBaseName() as SOURCE,

        @1:9T as [cust_id],

        @10:38T as [company_pay],

        if(right(@81:99T,1)='-', '-' & left(@81:99T, len(@81:99T)-1),@81:99T) as curren

      FROM "$(vFileName)" (ansi, fix, no labels, header is 0, record is line); 

      endif

      Next vFileName

      next i