1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
274 views
by sowmya-l-3811 (140 points)
we need to build a pre processor script to remove random double quotes from a source file before it gets processed

1 Answer

0 votes

You can accomplish this via a slight modification to the standard preprocessor script sample that shows when you enable the preprocessing script option..  Instead of using it to replace \r\n, use it to replace double quote characters.  

bytesOut = bytesIn;
 

bytesOut = new java.lang.String(bytesIn, qie.getChannelEncoding()).replace('"', '').getBytes(qie.getChannelEncoding());


if (bytesOut === null) {  //When null, the message is discarded and no further processing is done
   //todo: when bytesOut = null, set responseBytes to acknowledge the receipt of discarded messages as needed
   responseBytes = new java.lang.String('Replace with valid acknowledgement').getBytes(qie.getChannelEncoding());
}

by jon-t-7005 (8.2k points)
...