Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!dri500!slootman From: slootman@dri.nl (Paul Slootman) Newsgroups: comp.unix.wizards Subject: Re: inserting CR/LF Message-ID: <1060@dri500.dri.nl> Date: 17 May 91 19:09:24 GMT References: Organization: DataCount Register Informatici, Wierden, The Netherlands Lines: 16 img@eng.cam.ac.uk (Ian Green) writes: >I want to replace all occurences of LF in a file with the >sequence CR-LF. > >I have tried and failed with tr and sed. It must be easy! (I don't >want to write code/use emacs or vi.) Use this: sed `echo 's,$,\r,'` < input > output That should do it. The trouble you probably had was entering the carriage return (\r) directly; it gets turned into a newline (\n) by the Unix terminal handler. Paul.