Page 1 of 1

CR/LF Scrubing

Posted: Wed Mar 29, 2006 9:57 am
by SWW
Hi,

I am trying to create a routine that will scrub carriage returns and line feeds from the end of a field in the transform stage while the job is processing. This happens on our customer data when individuals cut and paste their address and leave a trailing CR/LF. My file layout is fixed and when this issue is incountered, the job aborts. To manually fix, I open the file in ultra edit and place cursor on corresponding line, backspace, hit the space bar twice to reposition the remaining fields of the record.

Is there any other way to rid CR/LF from a record?

Any help would be great.

Thanks, Steve

Posted: Wed Mar 29, 2006 10:20 am
by ArndW
You can set the column attributes on fixed-length input files to have "contains delimiters" and then use a derivation along the lines of "CONVERT(CHAR(10):CHAR(13),'',In.ColumnName)" to strip out the unwanted <cr> and <lf> characters.

Posted: Wed Mar 29, 2006 10:39 am
by roy
Hi,
As this post was made on the FAQ Discussion Forum Arnd assumed that this is related to a server job.
Please update the related details.
Also if this job is a Parallel job please note it so I can move it to the appropriate forum.

P.S.
Searching will find other routines that can do this task as well, but Arnd's solution is as good as any other you might find.

Good Luck,