Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

March 30, 2006

...


Submitted by Matt Castors, Chief of Data Integration, Pentaho

Just wanted to share a Kettle tip with you, this week on the subject of the Script Values step. Let's do ... 

...

Code Block
----tel.lpad(9, '0');

var newTel;

if (tel.getString().startsWith("02") || tel.getString().startsWith("03"))
{
  newTel=tel.getString().substr(0,2) + "/" + tel.getString().substr(2);
}
else
{
  newTel=tel.getString().substr(0,3) + "/" + tel.getString().substr(3);
}

For example when the input is 54250137, the output would be 054/250137.

...