On Fri, Oct 18, 2002 at 11:59:11PM +0900, Michael Campbell wrote: > > $ cat file | ruby -e 'STDIN.read.split(/\n\n/).each_with_index > > {|part,i| File.open("f.#{i}", "w").puts(part) }' > You can save a _few_ CPU cycles by removing cat there, no? Or am I > missing something subtle. By reading the file directly? Yes, you're not missing anything. I just like not to care whence the information comes from, be it a file or a socket or a command's output or whatever; the proposed form won't care about it either, and will just shut up and work. Plus I love awards. ;-) (See Stefan's link.) Massimiliano