on a UNIX machine, with PX server (v8.01)
For example, in a field i get filePaths.
but the slashes are twins ex : "C:\\toto\\toto1\\toto2\\toto3"
in a transformerStage (on a parallel job); how can I simply replace the double slash into a simple slash like : "C:\toto\toto1\toto2\toto3"
in a transformer stage (on parallel job) , Ereplace(), change() and pxEreplace() don't work as the compiler do not recognize these functions.
For internal reasons, I can't use an external routine.
left() and right() use is not a simple solution as the number of double-slash may change.
Convert() can't work either as it replaces only one character with another only one character.
Of course there is very badly ugly solution.
In a transformer stage, I set 25 stages variables using Field() function with "\" as separator and 1 to 25 as number of occurences.
Then I can concatenate the 25 stage variables if there are not empty.
But if there is more than 13 doubles slashes (and it can happen), I'll miss a part of the filePath.
Have you got an idea ?
What function to use for replacing string?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 19
- Joined: Wed Sep 08, 2010 6:47 am
What function to use for replacing string?
Last edited by blazDelParis on Wed Feb 09, 2011 9:17 am, edited 2 times in total.
it's good to give a fish to a hungry man
it's better to teach him fishing
it's better to teach him fishing
Split from this topic. I had to guess on the particulars (version, O/S) so if either are wrong please edit your post and correct them.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 19
- Joined: Wed Sep 08, 2010 6:47 am
thank you for your answer.
my boss doesn't like me using routines for some security reasons he says.
So I would rather like not using it but if it is the only way...
it's a pity there is not such a basic function shipped with datastage.
So i guess, I'll get the same problem for regular expressions.
If someone doesn't want to search here is the links to the good routines :
pxEreplace() :
http://66.34.129.47/viewtopic.php?t=138 ... 1b9c56fd6f
matching a regular expression :
http://66.34.129.47/viewtopic.php?t=107 ... 1b9c56fd6f
thanks to the authors of these routines
my boss doesn't like me using routines for some security reasons he says.
So I would rather like not using it but if it is the only way...
it's a pity there is not such a basic function shipped with datastage.
So i guess, I'll get the same problem for regular expressions.
If someone doesn't want to search here is the links to the good routines :
pxEreplace() :
http://66.34.129.47/viewtopic.php?t=138 ... 1b9c56fd6f
matching a regular expression :
http://66.34.129.47/viewtopic.php?t=107 ... 1b9c56fd6f
thanks to the authors of these routines
it's good to give a fish to a hungry man
it's better to teach him fishing
it's better to teach him fishing
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: