Page 2 of 2

Posted: Thu Jun 22, 2006 3:15 pm
by us1aslam1us
DSkkk wrote:Hi Sam..
There is one possible reason for the Low values. When u put a varchar field into a Char(N) Field, then EE Stage by default appends the remaning length with Lower values.
Kiran.
Hi Kiran,

My source fields are not only VARCHAR but also integer and others and this logic will not work if it is integer.

Thanks
Sam

Posted: Fri Jun 23, 2006 6:26 am
by kumar_s
What if you view the file from unix using vi <filename> or
cat -e <filename>?
Are the dots comming up?
Was your requirement to convert space into to null charcters?

Posted: Fri Jun 23, 2006 11:33 am
by us1aslam1us
kumar_s wrote:What if you view the file from unix using vi <filename> or
cat -e <filename>?
Are the dots comming up?
Was your requirement to convert space into to null charcters?
Hi Kumar

When i am doing the cat -e <filename>, i am getting ^@ symbols.I need to convert this to space.

Thanks
Sam

Posted: Fri Jun 23, 2006 11:40 am
by seanc217
You can try something like this in the derivation field of a transformer. This works for me.

convert(char(0):char(1):char(2):char(3):char(4):char(5):char(6):char(7):char(8):char(9):char(10):char(11):char(12):char(13):char(14):char(15):char(16):char(17):char(18):char(19):char(20):char(21):char(22):char(23):char(24):char(25):char(26):char(27):char(28):char(29):char(30):char(31),' ',DSLink2.YOUR_FIELD_GOES_HERE)

I had the same problem so I took all the unprintable low values and converted them to spaces.

HTH

Posted: Fri Jun 23, 2006 11:56 am
by us1aslam1us
seanc217 wrote: I had the same problem so I took all the unprintable low values and converted them to spaces.
HTH
Hi sean

Initially i thought so but after kumar's suggestion i think the culprit is ^@ symbol.

Thanks
Sam

Posted: Fri Jun 23, 2006 12:26 pm
by DSguru2B
Then do this

Code: Select all

convert(char(094):char(064),"",DSLink2.YOUR_FIELD_GOES_HERE) 
char(094) = ^
char(064) = @

Posted: Fri Jun 23, 2006 12:34 pm
by DSguru2B
on second thought ^@ is control character for NULL. Convert null to some value like space.
You know what, easiest way. Perform a sed operation on it and replace the nulls with a pipe instead of a space so that you can actually see that it did get converted.
Something like

Code: Select all


sed 's/\x00/|/g' file > newfile


OR better yet. Take your original file which has all the unprintable characters and apply this command to it

Code: Select all

sed 's/.$/ /' file > newfile
Got that from a previous post. But the sed command there just gets rid of all the non-printable characters. But the command above has been tweaked to replace the non-printable characters with a space.

Posted: Fri Jun 23, 2006 3:37 pm
by ray.wurlod
^@ is a representation of 0x00 (the ASCII NUL character). You could trim these, you could set APT_PAD_CHARACTER to space (" "), you could pre-process with sed or awk as DSGuru2B suggests.