From owner-freebsd-questions Tue Aug 8 13:22:20 2000 Delivered-To: freebsd-questions@freebsd.org Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236]) by hub.freebsd.org (Postfix) with ESMTP id 504DD37B715 for ; Tue, 8 Aug 2000 13:22:12 -0700 (PDT) (envelope-from ertr1013@student.uu.se) Received: from regulus.student.UU.SE ([130.238.5.2]:41505 "HELO ertr1013.student.uu.se") by merganser.its.uu.se with SMTP id ; Tue, 8 Aug 2000 22:21:37 +0200 Received: (qmail 3461 invoked by uid 1001); 8 Aug 2000 20:21:46 -0000 Date: Tue, 8 Aug 2000 22:21:46 +0200 From: Erik Trulsson To: Nathan Vidican Cc: questions@freebsd.org Subject: Re: Windows ASCII files -> Unix ASCII Files Message-ID: <20000808222146.A3443@student.uu.se> Mail-Followup-To: Nathan Vidican , questions@freebsd.org References: <399069B1.1AB04AFF@wmptl.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <399069B1.1AB04AFF@wmptl.com>; from webmaster@wmptl.com on Tue, Aug 08, 2000 at 04:12:33PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Aug 08, 2000 at 04:12:33PM -0400, Nathan Vidican wrote: > Is there any sort of utility to rip the ^M characters from the end of > each line in an ASCII text file as produced by Windows? I've tried using > a simple regexp with perl, as well as using chop/chomp, but niether seem > to work, any ideas? > > > I figure there has got to be some easy way of doing this? Right now > we're FTP get/binary, then FTP put/ASCII 'ing in order to convert; which > needless to say is a pain in the neck. > Any ideas or suggestions would be helpful. > Why not use tr(1)? Example: tr -d '\r' < infile > outfile That is probably the simplest soulution. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message