Skip to content

Instantly share code, notes, and snippets.

@srbhbook
Last active May 10, 2018 20:01
Show Gist options
  • Save srbhbook/5f837eb356f72f103616803b12a74ab8 to your computer and use it in GitHub Desktop.
Save srbhbook/5f837eb356f72f103616803b12a74ab8 to your computer and use it in GitHub Desktop.
// Mirth JS Split
var line;
var message = '';
while (line = reader.readLine()) {
message += line + '\r\n'; // 1 to N
try {
reader.mark(1); //Looks ahead
var nextline = reader.readLine();
if(nextline==null) break;
reader.reset();
if (nextline.indexOf("TAG")==0) {
break;
}
} finally {
//reader.reset();
}
}
return message;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment