# Put newline in front of every MSH but first
perl -pi.bak -e “s/(r.*?)MSH/$1nMSH/g”
# Remove the thread name from end of message
perl -pi.bak -e “s/(.*r).*$/$1/g”
# Put newline after last message
perl -pi.bak -e “s/[^n]z/n/”
There is also the command included with Cloverleag called “hcismatconvert “. You would use this command and pipe the output to a file or another command such as my scripts: https://usspvlclovertch2.infor.com/viewtopic.php?t=3097
Just to simplify things a bit I wrote a script to convert 5.8+ SMAT files to newline-delimted files for testing, etc. It works for all types inclucing HL7
The script works just as well on Unix. Simply remove the .htc extension and make sure it is executable.
I would recommend putting the script in $HCIROOT/contrib to make it available anywhere in the root
I tried to write it in such a manner to make it easy to modify for other SMAT purposes if wanted. All of the keys, etc are discussed at the top of the script
Run the command SMAT3NL at the command to see usage (pretty simple)