3 Replies Latest reply: Jul 4, 2013 7:22 AM by Dave Riley RSS

    Delimiter with multiple characters

      HI,

       

      Is there any possibility to create in a Store statement for txt file a multiple character delimiter?

       

       

      Here an example:

       

      Not working and I need this:

       

      //STORE $(vTableName) INTO $(vPathNameSaveExtractSFDB)$(vFileNameSFDB)$(vTableName).txt (txt, delimiter is '|^|');

       

       

      Thats the kind of delimiter I need.

      '|^|'

       

       

       

      Or if there is the possibilty to use this sign as a dlimiter    '¸'       asciii =184

       

      //STORE $(vTableName) INTO $(vPathNameSaveExtractSFDB)$(vFileNameSFDB)$(vTableName).txt (txt, delimiter is '¸');

       

      But when I am doing this then I am getting in the output txt file a delimiter as a question mark in a diamond.

       

       

       

      Thanks for Help

        • Re: Delimiter with multiple characters
          Dave Riley

          I don't think it's possible in the parameters although you can specify them when reading back in.  The easiest way is probably as per this script example ...

           

          data:

          load * inline [

          id, val,    sector

          1, ABC,        North

          2, BCD,        West

          3, CDE,        North];

           

          wrappeddata:

          load

              id & '|' as id|,

              '|' & val & '|' as |val|,

              '|' & sector as |sector

          resident data;

                 

          drop table data;

           

          STORE wrappeddata INTO data.txt (txt, delimiter is '^');

           

          data2:

          LOAD id,

              val,

              sector

          FROM

          [data.txt]

          (txt, utf8, embedded labels, delimiter is '|^|', msq); //note delimiter here

           

          flipside

            • Re: Delimiter with multiple characters

              Hi flipside,

               

              First of all thank you for help.

               

              I have updated my question with this part:

               

              Or if there is the possibilty to use this sign as a dlimiter    '¸'       asciii =184

               

              //STORE $(vTableName) INTO $(vPathNameSaveExtractSFDB)$(vFileNameSFDB)$(vTableName).txt (txt, delimiter is '¸');

               

              But when I am doing this then I am getting in the output txt file a delimiter as a question mark in a diamond.

               

               

               

              Do you know how to handle this?

                • Re: Delimiter with multiple characters
                  Dave Riley

                  You can use these special characters as delimiters by pressing Alt at the same time as the ascii code. The character will show in your script - incidentally that character I think is code 247 not 184 which is ©.

                   

                  Qlikview WILL generate a txt file but the delimiter character does not show in Notepad. QV WILL load the data correctly from the file (you will have to choose a standard delimiter then replace it in the script) HOWEVER Excel doesn't recognise them, so this might not be a suitable method, it will depend on what you intend to do with the file.

                   

                  I would advise you stick to delimiters below ascii 128 if possible or go with my original idea. It will be possible to add the pipe characters to your data and fieldnames using some dynamic routine to save having to manually write it.

                   

                  flipside