Page 1 of 1

special characters in sequentail file

Posted: Tue Sep 25, 2007 11:25 am
by say2prabhu1
While we are loading data into seqential file,it is padding with some special char(may be null).I want to remove the special char from file.I tried with padding option in column(field properties).. still some of the records are padding with null char .. If anyone already handled this problem, help me

Re: special characters in sequentail file

Posted: Tue Sep 25, 2007 12:02 pm
by Abhinav
Use environment variable $APT_PAD_CHAR to remove the default pad characters.

Abhi

Posted: Tue Sep 25, 2007 1:50 pm
by abhi989
you can use

cat -tv file_name to see if you have null padding. (^@ - if you see this symbol that means you have null padding.) if you do that you can use the following to get rid of that.

Add the transformer between the input_col and the output_col. Set input_col nullable to yes. And output_col nullable to no. put this in the expression editor.

left(trim(input_col, char(000)):space(length_of_the_output_col), length_of_the_output_col)

Hope this helps!!

Posted: Tue Sep 25, 2007 4:43 pm
by ray.wurlod
Use environment variable APT_STRING_PADCHAR to specify the padding character.

You are right that is it is, by default, 0x00. You could change it to, say, a space character.

Only CHAR data types are padded. You could also specify VARCHAR data types, which are not padded (unless writing to a fixed-width format text file).