Web Development

General discussion

Locked

Special Character Remover

By coopcaborojo ·
Hello!

I'm working on a migration from Cobol (85) to Oracle. I convert the Cobol data to ascii but Im having problem with special characters on the original data. I was thinking about developing a spec.char.remover routine on Cobol but, i know is gonna be a pain... Does anyone knows a "quick and dirty" way to remove special characters from a text file?

Carlos

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Very true...

Yes, Perl can be a headache, especially when someone slapped together a ton of code that is barely held together by implicit variables...

If one didn't like Perl, sed could do this just as easily. :)

J.Ja

Collapse -

Use sqlplus to remove special characters

by richard_simcoe In reply to Special Character Remover

13 is the ascii decimal value for carriage control and 10 is the ascii decimal value for line feed. The chr(n) function returns the character value. The || is the concatenation of the two. Use the replace function
-- replace (remarks,chr(13)||chr(10),' ')
An example follows:

SQL> select remarks from
2 iws_well_remark where uwi = '100013603906W500';

REMARKS
--------------------------------------------------------------------------------
PENN WEST DISPOSITION
EFFECTIVE DATE: OCTOBER 01, 1998
CONTRACT FILE: 05447


1 select replace (remarks,chr(13)||chr(10),' ') from
2* iws_well_remark where uwi = '100013603906W500'

REPLACE(REMARKS,CHR(13)||CHR(10),'')
--------------------------------------------------------------------------------
PENN WEST DISPOSITION EFFECTIVE DATE: OCTOBER 01, 1998 CONTRACT FILE: 05447

Related Discussions

Related Forums