Page 1 of 1

Finding and Replacing all Non Printable Characeters

Posted: Fri Jan 18, 2008 9:21 am
by horserider
Hello,

I am processing an employee file and the Name Column has some hidden characters some of them like

Horizontal Tabs (009)
Carriage return (002)

One way to check is to Use the SEQ() function on each of the caharacters on the Name Column, check the Value and replace them with something else...example for Horizontal tabs and carriage Return I can replace them with space....but that will require reading each and every character 1 by 1 in Name Column....

Question

Is there a way to use some Replace Function in parallel job that would replace any such characters in one command and I don't have to do the conversion manually?

Posted: Fri Jan 18, 2008 3:14 pm
by ray.wurlod
Convert() function.

Code: Select all

Convert(Char(9):Char(12), "", InLink.TheString)
This solution is sub-optimal, because it re-evaluates the Char() function twice for every row processed. Better would be to initialize a stage variable to Char(9):Char(12) and use that in the derivation expression.

Code: Select all

Convert(svNonPrintingCharacters, "", InLink.TheString)