Remove unwanted character from file using any stage

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
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Remove unwanted character from file using any stage

Post by sachin1 »

Hi,

Please let me know if we have any stage in Datastage 8.1 to remove unwanted character from file and move data further for processing.

regards,
Sachin.
ssreeni3
Participant
Posts: 29
Joined: Fri May 18, 2012 1:35 am

Post by ssreeni3 »

Hi Sachin,

For column data:Transformer convert function
For entire file :unix sed command

--------------
Sreeni
aravindunni31
Participant
Posts: 27
Joined: Mon Jul 09, 2012 6:51 am
Location: Chennai

Post by aravindunni31 »

If you are getting the character in file. You can even use trim command in unix and delete it. Sed, Awk commands will help if you need to replace it.
Regards,
Aravind V A
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

How about more specifics around what "unwanted character" might mean?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post by sachin1 »

There is ctrl M character in file, which i can remove using unix script, but wanted to remove using stage if any available.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use Convert() function in Transformer stage, as noted.

If the file is fixed width you could change the definition of the final column to be one character smaller, then define a new, Char(1) column that contains the Ctrl-M, and use the "drop on import" property for that column.

Or, of course, you could use tr -d '\r' or similar as the Filter Command in a Sequential File stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

At the end of each line or buried within data fields? For the former, read it as a DOS file.
-craig

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