Escape Pipe Characters In Extract

Discussions dedicated to share knowledge and experience with IBM MDM plug-in in CloverETL

listsos
Posts: 4
Joined: Fri Aug 18, 2017 5:51 pm

Escape Pipe Characters In Extract

Postby listsos » Fri Aug 18, 2017 5:59 pm

In CloverETL, I am creating an extract of our registry. The extract will be pipe | delimited.

The problem is that some of our attributes contain the pipe value, for example a first name is John|

I am attempting to escape these characters using a transformer but not having much luck.

Currently my Graph is:
Reader -> MEMGET -> Aggregate ->Transformer -> Output

In my Transformer, here is what I have as source code:

Code: Select all

function transform() {
   $0.FIRSTNAME := replace($FIRSTNAME, ",,", ",");
}

How do I specify to escape only the pipe character?

Thanks in advance!

vazquezrosariop
Posts: 111
Joined: Mon Feb 29, 2016 5:33 pm

Re: Escape Pipe Characters In Extract

Postby vazquezrosariop » Tue Aug 22, 2017 3:46 pm

Hi litsos,

You can try the following code to remove the pipe from any particular string:

Code: Select all

$0.Firstname := $Firstname.replace("\\|","");


Please let me know if this worked for you
---
Pedro Vazquez Rosario
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com
How to speed up communication with CloverCARE support

vazquezrosariop
Posts: 111
Joined: Mon Feb 29, 2016 5:33 pm

Re: Escape Pipe Characters In Extract

Postby vazquezrosariop » Wed Aug 23, 2017 2:42 pm

Hi litsos,

I wanted to ask you some follow up questions to gain a greater understanding of your use case:

  • Are you able to parse the data correctly or are you reading the data as one big string?
  • Are the string quoted?
  • Are you looking to completely replace the | character"
  • Please provide me with as much information on your use case as possible
---
Pedro Vazquez Rosario
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com
How to speed up communication with CloverCARE support