3 Replies Latest reply: Mar 6, 2017 3:12 AM by Sander van Heijst RSS

    How to import a csv where one header is empty and preserve the * in load statement?

    Sander van Heijst

      Scenario;

      In the load editor we want to use the * symbol instead of listing all header names individual to keep flexibel.

      Type is .csv

      The header names are located in row 1

      Issue is that "cell" B1 has a empty header name.

      How can I use the "embedded labels" names are in row 2 without loosing the * in the load statement?

       

      Capture.PNG

      code...

       

      set Import_Location = 'random netwerk location';

      load * inline [
      FIELD
      A
      B
      C

      ];

      FOR Each i in FieldValueList('FIELD')
          Trace #### LOAD_DATA_IN_MEMORY ####;
       
            LOAD_DATA: 
              LOAD distinct
                   Date(Date#(Textbetween(UPPER(Filename()),'$(i)'  & '.','.CSV'),'YYYYMMDD')) As Date,
                   *
               FROM  [$(Import_Location)]$(i).*.csv
                 (txt, codepage is 1252, embedded labels, delimiter is ',', msq)
               where left([ID],10) <> 'Disclaimer' and [ID] <> 'Total';

      .........