when processing the text file, it is best to use a regular expression to handle the line encoding.
reference for regular expressions in javascript: http://www.javascripter.net/faq/regularexpressionsyntax.htm
for example:
var SourceArray = source.getNode('/').split("\\r?\\n|\\r");
the above code will handle situations where the carriage return is present along with the newline, if newline is by itself, or if the carriage return is by itself.
Historically, MacOS's line encoding is \r, Windows is \r\n and Unix is \n
You can test the use cases by changing the line encoding in your sample messages,
Hex 0A = Newline (\n)
Hex 0D = Carriage Return (\r)
