Escape Pipe Characters In Extract

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:

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

How do I specify to escape only the pipe character?

Thanks in advance!

Hi litsos,

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

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

Please let me know if this worked for you

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

Issue resolved. Thanks!