string operations [message #664746] |
Tue, 01 August 2017 12:58 |
|
POGAKU_SANTHOSH
Messages: 39 Registered: April 2017
|
Member |
|
|
hi team,
i have a string 'MCDONALD_YYYYMMDD.TXT' i need to use regular expressions and append the '**' after the letter 'D' in the string given . (i.e In the string at postion 9 i need to append two '**' to the string .How to do that ?
Thank you .
|
|
|
|
|
|
|
|
Re: string operations [message #664754 is a reply to message #664751] |
Tue, 01 August 2017 14:03 |
|
Michel Cadot
Messages: 68665 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
POGAKU_SANTHOSH wrote on Tue, 01 August 2017 20:58second 'D' FROM STARTING .
SQL> select regexp_replace('MCDONALD_YYYYMMDD.TXT'...) from dual;
REGEXP_REPLACE('MCDONAL
-----------------------
MCDONALD**_YYYYMMDD.TXT
1 row selected.
Complete solution when you'll feedback and thank people in your previous topics (and feedbakc does not mean just thanks but answer the questions, explain the problem, the solution AND thank).
[Updated on: Tue, 01 August 2017 14:06] Report message to a moderator
|
|
|
|
|
Re: string operations [message #664768 is a reply to message #664756] |
Wed, 02 August 2017 06:36 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
The easiest way would be
select replace('MCDONALD_YYYYMMDD.TXT','D_','D**_') from dual;
by the way a regular replace will be much faster then a regexp_replace
|
|
|