Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.
Moderators: chulett, rschirm, roy
-
memrinal
- Participant
- Posts: 74
- Joined: Wed Nov 24, 2004 9:13 pm
Post
by memrinal »
We have a requirement to strip some bad words from the input - replace the bad words with a '-'.
for bad words, we have a list of reguler expressions - We need to substitute these reguler expressions with a '-'.
Currently I have implemented a demo of it using external filterstage. But I was looking for something within DS which can do this.
Is there a way we can have reguler expressions replaced by another string.
-
kandyshandy
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
Post
by kandyshandy »
search for "px version of ereplace" in dsxchange
or
Use basic transformer and use ereplace function.
Kandy
_________________
Try and Try again…You will succeed atlast!!
-
kandyshandy
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
Post
by kandyshandy »
If each bad word is a single character, then use CONVERT function in PX transformer stage.
Kandy
_________________
Try and Try again…You will succeed atlast!!
-
chulett
- Charter Member
![Charter Member Charter Member](./images/ranks/charter_member%s.gif)
- Posts: 43085
- Joined: Tue Nov 12, 2002 4:34 pm
- Location: Denver, CO
Post
by chulett »
You mean like 'F' and 'U'?
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
-
ray.wurlod
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
-
Contact:
Post
by ray.wurlod »
No, those ones would be replaced by something like
"#@!&!"
![Wink :wink:](./images/smilies/icon_wink.gif)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
memrinal
- Participant
- Posts: 74
- Joined: Wed Nov 24, 2004 9:13 pm
Post
by memrinal »
Well the reguler expressions need to be replaced by '-' would be like below.
\bDAMN\s?|FART|----(ED|ER|ING|ME|S)\b
\b(HELL|HORNY|J(AC|ER)K-OFF|JI(SM|Z(M)?))\b
\b(MOTHA|MOTHER)?----(ER(S)?|IN(G)?)?\b
I am not familair with ereplace,going to try now.
-
memrinal
- Participant
- Posts: 74
- Joined: Wed Nov 24, 2004 9:13 pm
Post
by memrinal »
HAs anyone else done regulerexpression repleacement in DS PX? Please let me know.
-
kandyshandy
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
Post
by kandyshandy »
Use a BASIC transformer. BASIC transformer is available in a PX job. If you want to know more about BASIC transformer, search for it in the forum.
BTW, this is the meaning of regular expression replacement !!
Kandy
_________________
Try and Try again…You will succeed atlast!!
-
ray.wurlod
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
-
Contact:
Post
by ray.wurlod »
Have you considered an External Filter stage that uses something like sed or awk commands/scripts?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.