From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthew Walker Newsgroups: gmane.emacs.help Subject: The last character of a file Date: Fri, 07 Nov 2003 12:34:51 +1300 Organization: Ihug Limited Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1068161655 6064 80.91.224.253 (6 Nov 2003 23:34:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2003 23:34:15 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 07 00:34:13 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AHtdl-0004CK-00 for ; Fri, 07 Nov 2003 00:34:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AHtaM-0006Ma-23 for geh-help-gnu-emacs@m.gmane.org; Thu, 06 Nov 2003 18:30:42 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!pd7cy1no!shaw.ca!news-out.superfeed.net!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!lust.ihug.co.nz!ihug.co.nz!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: 203-118-170-154.adsl.ihug.co.nz Original-X-Trace: lust.ihug.co.nz 1068161373 4280 203.118.170.154 (6 Nov 2003 23:29:33 GMT) Original-X-Complaints-To: abuse@ihug.co.nz Original-NNTP-Posting-Date: Thu, 6 Nov 2003 23:29:33 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en Original-Xref: shelby.stanford.edu gnu.emacs.help:117939 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13878 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13878 Emacs is adding a newline to the end of my file. I'd like it not to :o) I have a large file (~200Mb) that I wish to edit. Emacs tells me that it's too large to open. I only want to alter a few bytes in the first 1000, so I extract them using head: head --bytes=1000 source.file > source.file.head I then extract the end of the file: tail --bytes= source.file > source.file.tail Next on the list is to edit source.file.head, and then put the two files back together: cat source.file.head source.file.tail > source.file.updated My problem is that emacs seems not to like the fact that source.file.head doesn't end with a newline. It seems to feel compelled to add a newline to the end of the file. The file is now 1001 bytes in size, and they just don't append nicely like that. I could cut off the last byte by head --bytes=1000 source.file.head | cat - source.file.tail > source.file.updated But I'd like more to know either: * how to edit the file with emacs, or * how to stop emacs from adding the newline. Thank you for your thoughts, Matthew.