From: Xavier Noria Date: 2007-09-26T00:39:30+09:00 Subject: Re: Spliting input at blank line On Sep 25, 2007, at 5:27 PM, Arfon Smith wrote: > I'm trying to read in a file with blocks of text separated by blank > lines. How do I go about spliting the input file using the blank > lines > as delimiters? If blank lines are regular: File.foreach(fname, "\n\n") do |block| # ... do something with block.chomp end Otherwise slurp the entire file and blocks = contents.split(/\n\n+/) -- fxn