From: Robert Klemme Date: 2007-08-03T21:59:06+09:00 Subject: Re: Updating header in file 2007/8/3, Jon Hawkins : > look into using the .slice(# , #) method. so long as you know the > length of the first line u can probably just slice it out This is a dangerous approach as it will work for the minority of cases only (i.e. when old and new line have the exact same length). Though you could make it work for cases where the new line is shorter than the old line things get messy if you try to cope with the opposite case. Ah, and Jeffrey, do yourself a favor and use the block form of File.open (btw, your sample does not work anyway since File.open(file_name) will open for reading only). File.open(foo, "a") {|fi| fi.puts x} Kind regards robert