Sidebar

preprocessor script needed to remove random double quotes

0 votes
121 views
asked Jun 21, 2023 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());
}

answered Jun 21, 2023 by jon-t-7005 (7,590 points)
...