msgExtract examples

Examples of using msgExtract include:

  • msgExtract bnd01ms4p_in.tin.msg > test.hl7

    This converts the whole SMAT .msg file to a newline-delimited file called test.hl7. This is useful for resending the message to an inbound thread. For example:

    hcicmd -p bnd01 -c 'bnd01ms4p_in resend
    				  ib_pre_tps data 520 test.hl7 nl'
  • msgExtract
    				*.tin.msg > test.hl7

    This converts all .tin.msg files in the current directory to a newline-delimited file called test.hl7.

  • msgExtract
    				bnd01ms4p_in.tin.msg | grep A31 > test.hl7

    This extracts only A31 messages from the SMAT .msg file.

  • msgExtract
    				bnd01ms4p_in.tin.msg | egrep 'A01|A11' > test.hl7

    This extracts A01 and A11 messages from the SMAT.msg file.

  • msgExtract
    				bnd01ms4p_in.tin.msg | tr -d '\r'

    This displays the whole message on the screen, unparsed, without the carriage returns (\r), and with each message on its own line. You can also keep piping to other commands, for example, tail or head.

  • msgExtract
    				bnd01ms4p_in.tin.msg | perl -p -e 's/TEST\^TEST/HELLO\^WORLD/' >
    				test.hl7

    This example demonstrates that you can also pipe to perl. Numerous UNIX commands are available to do analysis.