× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Robert Poinsatte wrote:
I use sed once in a while. It seems to always takes me forever to get
the command to work. I had a ASCII file that I needed to take out the
tabs (hex 09). The output file that sed created was EBCDIC. Finally
figured out I had to remove hex 05 not hex 09 to get it work. My 2
cents.

This is not an issue with sed... this will always happen character sets are
mixed.

Scott Klement wrote:
... really makes it ugly. But it should work:

sed "s:\\\\\.br\\\\:$(print '\\\r\\\n'):g" in.hl7 > out.hl7

(I also replaced the % with : -- IMHO, % is ugly)

I was hoping you'd come up with a solution, since mine (above) is so ugly.
:)

Best I can do is:
CRLF=$(print '\\r\\n'); sed "s:[\\][.]br[\\]:${CRLF}:g" < in.hl7 >
out.hl7

A little less ugly, methinks. But GNU has it beat hands down!

Joe Wells wrote:
However, when I use this against a live file I have a
problem. The live file contains stand alone cr (x'0d')
as line delimiters.

A minor modification should resolve. Below is not tested.
CRLF=$(print '\\r\\n');
CR=$(print '\\r');
sed -e "s:${CR}:${CRLF}:g" -e "s:[\\][.]br[\\]:${CRLF}:g" < in.hl7 >
out.hl7

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
Patience - a minor form of despair disguised as a virtue.
-- Ambrose Bierce




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.