Page 1 of 1

Remove unwanted character from file using any stage

Posted: Thu Oct 25, 2012 4:05 am
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.

Posted: Thu Oct 25, 2012 4:18 am
by ssreeni3
Hi Sachin,

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

--------------
Sreeni

Posted: Thu Oct 25, 2012 4:44 am
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.

Posted: Thu Oct 25, 2012 7:05 am
by chulett
How about more specifics around what "unwanted character" might mean?

Posted: Wed Oct 31, 2012 12:03 am
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.

Posted: Wed Oct 31, 2012 12:25 am
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.

Posted: Wed Oct 31, 2012 6:07 am
by chulett
At the end of each line or buried within data fields? For the former, read it as a DOS file.