6 Replies Latest reply on Mar 30, 2020 12:55 PM by Jonathan Chabot

    Replace CRLF in export templates

    Jonathan Chabot New Member

      Hi Evryone.

      I'm extracting Items fileds using the export template perspective.

      These fields are containing html which is ok but some values are copied/pasted from the web and contains CRLF or just LF..

       

      What I want to do is replace them by empty space.

      Is there a way I can do this ?

      I tried with the replace function but I dont know what to search.

       

      I know that CRLF are CR: char 13 and LF char 10 (SQL, ASCII)...

       

      I'm opening these files using Microsoft Integration Services and it fails at the source because of that.

       

      Thanks to all of you !

        • 1. Re: Replace CRLF in export templates
          Sai Narasimha Prasad Rebba Guru

          Hi Jonathan,

           

          Please try with the following rich text properties in plugin_customization.ini file.

           

          # Richtext SERVER Settings

           

          # If "false", paragraphs are replaced with single line breaks -> DB Markup <CRLF>

          # If "true", paragraphs are saved as they are -> DB Markup <PAR>text</PAR>

          # com.heiler.ppm.richtext.server/enable-paragraphs = false

           

           

          # if "true" the "non-breaking space" characters are removed from the rich text before saving

          # com.heiler.ppm.richtext.server/remove-nbsp = true

           

          Thank you

          Sai Prasad

          • 2. Re: Replace CRLF in export templates
            Ryan Jenson Seasoned Veteran

            Hi Jonathan,

             

            You may want to consider the {?StringRemoveLineBreak} function:

             

             

            Alternatively you may need the {?Replace} function and search for all instances of the characters causing issues (open the raw text and copy/paste the LF/CRLF characters into the quotes).

            • 3. Re: Replace CRLF in export templates
              Jonathan Chabot New Member

              Hi Ryan.

              Thank you very much.

              That worked, but just the LF where replaced using the StringReplaceLineBreak function. Now what it done is that it removed the LF from the CRLF so I'm stuck with the CR... I can see the function StringRemoveNewLineCharacters from the list but I don't see this one in my list of function. Maybe that's because of the PIM 360 version ?

               

              We are on the 8.0.6.04.00 version.

               

              I would like to use the Replace function but I don't know what to put in the quotes.. What to search for.

              In notepadd ++, I'm not able to copy the CR.

               

              Copy paste of the column value:

              <br>  

              <br>

              <br>3 Watts CREE • 220 Lumens • LED flood light

              <br>Merithian

              <br>       

              <br>Rechargeable 3.6V NiMH battery with 120V AC and 12V DC charger. Hi-Low brightness settings. 2 hour run time on low setting, 4 hour on high setting. Charge status indicator light. Rugged impact resistant weather proof housing

              <br>

               

              Export template outputted file:

               

              Rich text original

               

                 

                     

              3 Watts CREE • 220 Lumens • LED flood light

              Merithian

               

              Rechargeable 3.6V NiMH battery with 120V AC and 12V DC charger. Hi-Low brightness settings. 2 hour run time on low setting, 4 hour on high setting. Charge status indicator light. Rugged impact resistant weather proof housing

               

               

               

              Rich Text Source

              <br />

                  <br />

                      <br />

              3 Watts CREE • 220 Lumens • LED flood light<br />

              Merithian<br />

              <br />

              Rechargeable 3.6V NiMH battery with 120V AC and 12V DC charger. Hi-Low brightness settings. 2 hour run time on low setting, 4 hour on high setting. Charge status indicator light. Rugged impact resistant weather proof housing

              • 5. Re: Replace CRLF in export templates
                Ryan Jenson Seasoned Veteran

                Jonathan,

                        

                I think the problem you are now having (being stuck with CR) is a result of the default function not searching for "\r" (the escape character for CR). If you search the proper .jar file you'll notice there is no indication that it would replace a standard carriage return:

                 

                \Informatica\PIM\server\plugins\com.heiler.ppm.script.core_4.5.0.r60351.jar

                     \com\heiler\ppm\script\core\internal\functions\FunctionStringRemoveLinebreak.java

                 

                 

                I have access to a custom funtion(s) that would include \r and the full \r\n:

                 

                I'll leave it attached if you wish to inspect- just be sure to test on a dev environment first!

                Look for the {?StringRemoveNewLineCharacters} function and edit to your liking.

                • 6. Re: Replace CRLF in export templates
                  Jonathan Chabot New Member

                  Wow, thank you very much for your time !

                  I will take a look at that and give you some feed back,

                   

                  Thanks again !