From owner-freebsd-questions Wed Apr 3 12:59:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from PHSEXCHICO.MGH.HARVARD.EDU (phsexchico.mgh.harvard.edu [132.183.126.50]) by hub.freebsd.org (Postfix) with ESMTP id 49C9737B41A for ; Wed, 3 Apr 2002 12:59:45 -0800 (PST) Received: by phsexchico.mgh.harvard.edu with Internet Mail Service (5.5.2650.21) id ; Wed, 3 Apr 2002 15:59:36 -0500 Message-ID: <375F68784081D511908A00508BE3BB17DDDD31@phsexch22.mgh.harvard.edu> From: "Morse, Richard E." To: 'Peter Leftwich' , ann kok Cc: FreeBSD Questions Subject: RE: special charaters (return key) Date: Wed, 3 Apr 2002 15:59:34 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Peter Leftwich [mailto:Hostmaster@Video2Video.Com] wrote: > On Wed, 3 Apr 2002, ann kok wrote: > > Hi all - how do type the special charater? ^M (return key) > - I want to remove it on the file > > > > eg [root@ann work1]# cat -v crt2.txt > > test^M > > a^M > > b^M > > c^M > > d^M > > e^M > > > > sed 's/^M//g' crt1.txt > > Thank you > > The manpage for sed says there is some issue with the newline > character > "\n" so this may not be the best approach to the problem. > Was crt1.txt > created in DOS or on a Mac? :) It was created on a DOS computer. If it was on a Mac, it wouldn't have had the newline (^J) which showed the separate lines. Try using '\r' instead of '^M' in the line above, and see if that helps... HTH, Ricky To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message