unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* The last character of a file
@ 2003-11-06 23:34 Matthew Walker
  2003-11-06 23:41 ` Dan Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matthew Walker @ 2003-11-06 23:34 UTC (permalink / raw)


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=<filesize-1000> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-08  0:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-06 23:34 The last character of a file Matthew Walker
2003-11-06 23:41 ` Dan Anderson
2003-11-07 17:44 ` Stefan Monnier
2003-11-08  0:48 ` Thien-Thi Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).