Maybe I should take the time to explain what we are trying to do, since there could be another solution.
Took a flat file and translated it to hl7, but we did not want all of the records to go to into the database. I copied the hl7 messages (hcidbdump) to a file which was then given to the user. They went through the file and removed the messages they did not want to send. Now they tried using both word and wordpad for this task. When they save the file and we put it back on the Cloverleaf we are missing the control character; in some cases we lost the CR (word) and in others we lost the NL (wordpad). Either way, I am trying to figure out how we can do this with some sanity.
Suggestions on how to save this file without loosing the control characters or the best approach at putting them back in is appreciated.
My guess is Windows was trying to be your “friend” and put line feeds to go with the carriage returns. A simple approach use perl. If there are multiple records it may take two commands
perl -pi -e ‘s/n//g’ file
Then to put linefeeds back after each record
perl -pi -e ‘s/rMSH/rnMSH/g’ file
Note that file could be a single file like hl7.dat or multiple files like *.dat
assumes Unix
Author
Replies
Viewing 3 reply threads
The forum ‘Tcl Library’ is closed to new topics and replies.