The translate function returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding position in the third argument string.For example, translate("bar","abc","ABC") returns the string BAr.
If there is a character in the second argument string with no character at a corresponding position in the third argument string (because the second argument string is longer than the third argument string), then occurrences of that character in the first argument string are removed. For example, translate("--aaa--","abc-","ABC") returns "AAA".
If a character occurs more than once in the second argument string, then the first occurrence determines the replacement character. If the third argument string is longer than the second argument string, then excess characters are ignored.
Question: have run into an issue with the "Translate" string function.
I am attempting to do a search and replace in a record.
The record has numerous escapes, and end of field characters.
A sample looks like this:
0,1,A.F.S. General Elec\, tric Financial, 354672,874635,\N,\N,,,,,
I am attempting to remove the '\,', and the '\N' from the string so that
I have a comma delimited record. When using translate to locate the '\,' and substitute with a space ' ',
translate removes all instances of comma, slash, and comma slash.
Is there a way to treat the quoted characters as a single item? That
is, to remove only instances of \,?
java:com.adeptia.indigo.services.mapping.support.dboperation.ReferenceConnectionDBOperation.replaceAllIgnoreRegularExprjava:com.adeptia.indigo.services.mapping.support.dboperation.ReferenceConnectionDBOperation.replaceAllIgnoreRegularExpr($Input_MAI_RtnFile_Tschm_pwEA/Root/Record/MAI_Return_File , '\,' , '' ) ,'\N' , '' )
Where $Input_MAI_RtnFile_Tschm_pwEA/Root/Record/MAI_Return_File is the xpath of the source field name.