2 Replies Latest reply: Aug 8, 2013 12:19 PM by Mike-Matthews-Oracle RSS

    Adding quotes


      I have a lot of string attributes and I want to add quotes to them.

      For example if my Table has 3 columns

      ColumnA ColumnB ColumnC

      abc         jaksd       asdjk

      bafsd      sa           asdhjkldkj


      I want the output to be as

      'abc'         'jaksd'       'asdjk'

      'bafsd'      'sa'           'asdhjkldkj'


      Which transformation process would do this ?

        • 1. Re: Adding quotes
          Nick Gorman-Oracle



          You can achieve this on an individual attribute basis using a RegEx Replace processor using:


          Expression: ^(.*)$

          Replacement: '$1'


          Unfortunately there is no processor which does this across multiple input attributes so you'll need to use a separate instance for each one.


          Do you really need the quotes in EDQ or is this for exporting to a file?




          • 2. Re: Adding quotes

            Another way to do this is to use Add String Attribute to create a Quote attribute with a value of '. Then concatenate this with the value at beginning and end. (I forget if Concatenate allows you to use the same attribute twice, if not use Add String Attribute again).


            The reason I mention this is it is quite a nice exercise in creating a new processor with a sequence of a few base processors. Once configured, select all the processors, right-click and select Create Processor. You can then expose the option that specifies the quote character and make a processor that adds whatever quote character you want from a simple option. Then right-click and publish it to the Tool Palette for reuse.