Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a input data which has a special character like
"maths*science*English"
my ouput should have data like
science
English
the position of the special character is not fixed and I should consider the occurrence of special character based on the other column i.e., if the other column has data like 3 I should consider the 3rd occurrence of the special character.
Thanks in Advance,
Lmit
Another simple solution
Input -- tjavarow -- Output
input
id,newColumn,pos
1,abc*dfec*eng,1
2, abc*dfec*eng*math,3
tjavarow
output_row.id = input_row.id;
try {
output_row.result = input_row.newColumn.split("\\*")[input_row.pos];
}
catch ( Exception e ){
output_row.result = "Err - Not found";
}
Output
id|result
1|dfec
2|math