Skip to content

Instantly share code, notes, and snippets.

@viksingh
Forked from SriniBlog/splitValue.java
Created February 9, 2018 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viksingh/e111f734c215827843c09718391ae1e9 to your computer and use it in GitHub Desktop.
Save viksingh/e111f734c215827843c09718391ae1e9 to your computer and use it in GitHub Desktop.
This Advanced UDF use to split the field value based on the splitter character
public void splitValue(String FieldValue, String SplitterChar, ResultList result, Container container) throws StreamTransformationException{
try{
//Split the string value based on the splitterchar
String [ ] strArray = FieldValue.split(SplitterChar);
int istrArray = strArray.length;
for (int i=0; i < istrArray; i++){
result.addValue(strArray[i]);
}
}catch(Exception ee){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment