Hi,
Currently I am splitting OBX into multiple OBX at /.br/ (OBX-5) but the source is sending ??, ???, ? followed by some of the /.br/ and I need to eliminate them as well.
Example: \.br\??? Content.\.br\? Content2.\.br\Content3
The current result is
OBX|||||??? Content.
OBX? Content2.
OBX|||||?Content3
So the current script I am using is and I need to remove the ?? and ? and ??? at the begining of the OBX segment or at the begining of OBX5 specifically.
var obxString = message.getNode('OBX-5'); var obxArray = StringUtils.splitByWholeSeparator(obxString, '\\.br\\');
message.removeAllNodes('OBX');
for (var i = 0; i < obxArray.length; i++) {
if (StringUtils.length(obxArray[i]) > 0) {
message.addChild('/', 'OBX', 'OBX||TX|' + obxArray[i].trim());
}
}
var segCount = message.getCount('OBX');
for (var j = 1; j <= segCount; j++) {
message.setNode('OBX-1', j + '', j);}