Trimming white spaces in the string.
vissuNov 18 2010 — edited Nov 19 2010Hi all,
I wanna know how to trim the white spaces in the entire line while reading the file. For suppose, the below line has,
'10/7/2010,,DRI DEV,,07A0002EE ,BIOS 0.75FAWARM 2.003 ,DRI,,215461 D ,2.0.5-O ,,,,manson,Gear IT,07A0002EE '
I am using regexp_replace function. but I'm not able to use in the proper way. See the below query:
select trim(regexp_replace('10/7/2010,,DRI DEV,,07A0002EE ,BIOS 0.75FAWARM 2.003 ,DRI,,215461 D ,2.0.5-O ,,,,manson,Gear IT,07A0002EE ','[[:space:]]')) text
from dual;
o/p: 10/7/2010,,DRIDEV,,07A0002EE,BIOS0.75FAWARM2.003,DRI,,215461D,2.0.5-O,,,,manson,GearIT,07A0002EE. Here, space also replacing including white spaces. I don't want replace the space only remaing whitespaces need like expected o/p.
Expected O/p: 10/7/2010,,DRI DEV,,07A0002EE,BIOS0.75FAWARM2.003,DRI,,215461D,2.0.5-O,,,,manson,Gear IT,07A0002EE
Oracle version:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production
Please help me.
Thanks in advance!!
Regards,
Vissu...