From: Soichi Ishida Date: 2013-02-04T11:03:47+09:00 Subject: Re: Class for data analysis: File.open once Thanks everyone. They will certainly help. In addition to these, what if I want to apply specific regular expressions to each of the lines? say, if line =~ /exp1/ then # do stuff else # do stuff end In this case, the loop for all lines must be implemented, am I correct? If the class methods dynamically take regular expression like test = DataExtractor.new('file.txt') test.apply_regexp(/exp1/) Doesn't the loop need to be reactivated for each method like this? soichi -- Posted via http://www.ruby-forum.com/.