Page 1 of 1

Appending leading Zeros and writting to excel file

Posted: Wed Feb 11, 2009 11:24 am
by neo637
Hi,

I am trying to generate excel file in data stage.
In doing so i have a problem, When i am trying to append leading Zeros to a filed and witting into excel file all the leading zeros are stripped off.

Can some one help ma in solving this.

Thanks in advance.

Re: Appending leading Zeros and writting to excel file

Posted: Thu Mar 19, 2009 2:32 am
by Pagadrai
neo637 wrote:Hi,

I am trying to generate excel file in data stage.
In doing so i have a problem, When i am trying to append leading Zeros to a filed and witting into excel file all the leading zeros are stripped off.

Can some one help ma in solving this.

Thanks in advance.
Hi,
You can try using quotes for the fields so that the leading zeros are preserved in the output.

Posted: Thu Mar 19, 2009 3:36 am
by ray.wurlod
Format the cells in the worksheet so that leading zeroes are displayed.

Posted: Thu Mar 19, 2009 7:59 am
by chulett
This is a common problem for anyone creating 'Excel' files which a search here or a quick Google would turn up... and one not easily solved. Without a pre-formatted target and the GUI, Excel will always convert anything that looks like a number to a number during an import and remove any non-significant things like leading zeroes.

For csv files, the 'trick' is to create the files as .txt files and teach the user how to force the import to use Text for the field(s) in question to preserve any leading zeroes.

http://excel.tips.net/Pages/T002588_Han ... Files.html