3 Replies Latest reply: Feb 13, 2012 5:10 AM by Hans Maulwurf RSS

    Character mapping hexadecimal

      Hello,

       

      I have the following script:

       

      mapping_table:

      MAPPING LOAD * INLINE [

      x,y

      (HEX)DEBB, ö

      ...

      ];

       

      table1:

      LOAD @1 as name

      FROM [file.txt] (txt, ansi, codepage is 1252, no labels, delimiter is '|', msq);

       

      Now I would like to map the field 'name' to replace some serious characters:

       

      table2:

      LOAD mapsubstring('mapping_table', name) as nameNew

      RESIDENT table1;

       

      To avoid failures through interpreting by qlikview a hexadecimal value is necessary. In the end the serious characters should be shown as ä,ö,ü,ß, ...

       

      Can anyone help me to replace the characters?

        • Character mapping hexadecimal
          Stefan Wühl

          Could you provide a sample text file that you want to load and map?

            • Character mapping hexadecimal

              Sry, this is currently not possible.

               

              The txt.file was copied from a unix / z/os system to a windows system, so there is a problem with the utf-8 standard. The characters ä, ö, ü are displayed very serious.

               

              Changing 'ansi' to 'utf-8' or 'oem' in the load script doesn't fix the problem.

                • Re: Character mapping hexadecimal

                  Hello, I'm trying to replace special characters to normal characters in a text file. I've only the HEX-Code of the special characters. 

                   

                  So I have the following example table:

                   

                  Table1:

                  LOAD * INLINE [ field1

                  abc*356,

                  dsfsdf*45$6 ];

                   

                  The result should be:

                  abc\356,

                  dsfsdf\45$6

                   

                  Currently I have the following script:

                   

                  Mapping:

                  MAPPING LOAD * INLINE [

                  x, y

                  (Hex)42, \      // Replace '*' with '\'

                  ];

                   

                  table2:

                  LOAD

                  mapsubstring('Mapping', @1) as field1

                  FROM D:\xyz.txt (txt, codepage is 1252, no labels, delimiter is '|', msq, no eof);

                   

                  I assume that (Hex)42 would not be interpreted correctly in mapping tables. The character '*' is only an example to show you the problem. The special characters of the original text file isn't representable. I only know the HEX-Code.