From: Richard Schneeman Date: 2008-08-24T08:39:51+09:00 Subject: Re: Open file, get first line, delete first line close file Richard Schneeman wrote: > > > > That is one option...the reason i need to be able to delete lines, is > that i am running a rake task on a server, that i cannot easily modify > files, and I can't predict how long the rake task will time out. The > task takes entries from text based dictionaries and adds it to my DB, > the thing is, if i didn't delete the lines i've already added, everytime > i ran the task, (it has to be run multiple times due to timeouts) i > would only re-add the same lines. The deletion acts as a place holder of > sorts. I'll play around with your suggestion, and i'll let you know. If > anyone else has an alternate method...i'm all ears Its gross but it works active_dictionary = File.readlines("public/languages/chinese/practice.txt") open('public/languages/chinese/practice.txt', 'w') do |file| file.puts active_dictionary[1,active_dictionary.size] end Once again, i'm interested in different approaches, or something, not quite so processor intensive -- Posted via http://www.ruby-forum.com/.