From owner-freebsd-questions@FreeBSD.ORG Fri Oct 27 21:33:41 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 700AE16A403 for ; Fri, 27 Oct 2006 21:33:41 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AC1C43D6D for ; Fri, 27 Oct 2006 21:33:37 +0000 (GMT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id k9RLUY3A098645; Fri, 27 Oct 2006 17:30:34 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id k9RLUY9D098644; Fri, 27 Oct 2006 17:30:34 -0400 (EDT) (envelope-from jerrymc) Date: Fri, 27 Oct 2006 17:30:34 -0400 From: Jerry McAllister To: Noah Message-ID: <20061027213034.GD98266@gizmo.acns.msu.edu> References: <45425D61.6030209@enabled.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45425D61.6030209@enabled.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: replacing ^M with emacs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2006 21:33:41 -0000 On Fri, Oct 27, 2006 at 12:26:25PM -0700, Noah wrote: > Hi there, > > It appears that a text editor placed a bunch on ^M throughout a text > file I am working with. I assure this is equivalent to eh keystroke > control-M. This is probably "MS-DOS" type text file. MS text file lines all end in a CR-LF character pair whereas UNIX text file lines have only a LF (line feed) and the end of each line. All text editors on MS systems do that and if you do a binary transfer of a file from MS to UNIX you will get all the extra ^M characters showing up. most versions of ftp have an ASCII mode that will do the conversion for you as you transfer the file back and forth between MS and UNIX. I think SCP only does binary transfers. I am not an Emacs user, but, You can easily use tr(1) to remove all the ^M characters from a file. tr -r "\r" goodfile where badfile is the one with the ^M characters and goodfile is the newly cleaned copy. The only anoying thing is having to write to a second file and then get rid of the first or mv the new one back to the old (as in: mv goodfile badfile after doing the tr. ////jerry > > How might I get emacs to search replace > > also is there a mail list focused specifically on emacs usability? > please refer me to it? > > Cheers, > > Noah > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"