External Filter stage command

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

Post Reply
ureddy
Premium Member
Premium Member
Posts: 36
Joined: Wed May 14, 2008 1:59 pm

External Filter stage command

Post by ureddy »

Hi,

I tried to replace a string with spaces in external filter stage with sed command. Its not giving the expected result. Looks im missing some thing in the sed command?

Source:
THE STATE CA THE STATE NY

Output:
CA NY

So need to replace the THE STATE with the 9 spaces.

Tried sed -e 's/THE STATE/ /g' but its throwin the below error.

"On output connection 1 (for connection 1) at record 0: Field "one" lacks whitespace delimiter, at offset: 50 "
tried with giving quote to string (sed -e 's/"THE STATE"/ /g' ) but the job completing and output is coming same as source.

When I use one word (THE) for replacement its working. Below is working.
sed -e 's/THE/ /g'
Please suggest me where im giving wrong in sed command

Thanks,
Ureddy
Reddy
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You should be aware by now that all of your examples need

Code: Select all

[/b] tags around them to preserve all that 'extra' whitespace you'd like us to be able to see.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ureddy
Premium Member
Premium Member
Posts: 36
Joined: Wed May 14, 2008 1:59 pm

Post by ureddy »

Hi chulett, thanks for the suggestion.
you mean \[ ] need to include to handle space?

can you please put the complete command

Thanks,
ureddy
Reddy
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, I mean the "code tags" that are available on any web board like this and which you have buttons for right above where you type when composing a text. I'm going to enable the "Disable BBCode in this post" option here so you can see what they look like when editing. Leave the option off and use "Preview" to see them in action.

[code]sed -e 's/THE STATE/ /g'[/code]
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Now on:

Code: Select all

sed -e 's/THE STATE/           /g'
-craig

"You can never have too many knives" -- Logan Nine Fingers
ureddy
Premium Member
Premium Member
Posts: 36
Joined: Wed May 14, 2008 1:59 pm

Post by ureddy »

The mistake I have done is , not keeping the same number of spaces :oops:

Its working fine now. Thank you so much Chulett!!
Reddy
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... good. Glad I could help, somehow. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply