msgExtract

This converts the SMAT .msg file to a newline-delimited file. This is useful when you create a file that is resent to a thread with hcicmd.

#!/hci/cloverleaf/cis6.2/integrator/bin/perl
###########################################################################
#
# Name: msgExtract
# Purpose: Convert tin/tout file(s) to newline-delimited files (one message per line)
# Note: works on multiple files (ex. msgExtract bn10ms4_in.* > tmp.hl7)
#
###########################################################################

#$/ = "";

while (<>) {
    s/MSH\|/\nMSH\|/g;
    s/^\n//;
    s/$/\x0A/;
    print;
}

# End of Script