Tuesday, May 11, 2010

Hex to integer Conversion in Kettle

0 comments
To convert your Hex value to integer in spoon do the followings
Go to the design mode.
Drill Down the Scripting step.
Drag and drop the Modified Java Script Value.
image
Double Click the Modified Java Script Value and drill down the Transformation Script available at the left hand side of the Script Mod, double click the ScriptValue
in the Script Value paste the following lines
java;
var nummerke = Packages.java.lang.Integer.valueOf(Hex.getString(), 16).intValue();
here Hex is your input value coming from another step, at the bottom of a Script Mod click the Get fields Button now you have get the converted variable with its data type showing in a grid, finally test the script.
image

0 comments: