PDA

View Full Version : Excel input formatting question



surenm
02-03-2006, 07:18 PM
I have an Excel sheet as input. One of the columns is a 3-digit number that I would like to save as a string. On the Excel step, I choose the type of the field as string with length as 3.


I am outputing to a text file. I am finding that it is still taken as a number and the output shows a decimal point. For example, 101 as input gets stored as 101.0 in the output file.



Changing the format on the Excel side also has not worked.



What do I need to fix this ?

MattCasters
02-04-2006, 02:14 AM
Hi,

Excel doesn't know about integers, just number (floating point)
So if you convert it to String in the Excel Input step, you get the .0 appended.
Better to convert it to Integer using a "Select Values" step and by changing the meta-data for the field.
That way, the Number field from Excel gets rounded to an integer (losing the .0)

Even easier, you can specify the Number field in TextFileOutput as well, set the format the "0".

Hope this helps,

Matt

surenm
02-04-2006, 05:00 AM
Hi Matt,

That did work. Thank you.

Brian
03-02-2012, 02:31 PM
WhaT If the column consists on number data and text data (don't ask why), then you can't change the metadata to integer. How then do you prevent the numbers from outputting as 101.0