From: Admin Tensor Date: 2012-08-13T03:39:15+09:00 Subject: Re: Delete a lines from a files Robert Klemme wrote in post #1072104: >> ruby -e 'BEGIN{$/=nil}; puts STDIN.readlines.to_s.gsub(/^john.*$/, "")' >> < your_file > > Why do you set the input record separator to nil? How then should > readlines work? Also, I hope you are aware that readlines will read > in the whole input before outputting anything. This is quite > inefficient for medium to large files. ARGF might be better, too. Well, I haven't tried the code yet. For your questions, probably better to ask Dave Thomas... :) I took it from his one liners. Regards, Bill -- Posted via http://www.ruby-forum.com/.