From: Cthulhu __ Date: 2008-06-19T03:10:34+09:00 Subject: Re: parsing text into usablle numerical data Still having some problems with this program. I'm getting a TypeError when the value of dx, *dat = line.scan(/\d+/).map.compact is nil Any suggestions on how to handle this? my current implementation looks like this: raw_data = Array.new File.foreach files_to_parse[i].to_s do |line| idx, *dat = line.scan(/\d+/).map.compact! {|s| s.to_i} raw_data[idx] = dat end but if I include a conditional statement that excludes nil inside this block {|s| s.to_i} then the size of the array changes, which i need to avoid. --m -- Posted via http://www.ruby-forum.com/.