From: i3w Date: 2008-10-04T02:58:38+09:00 Subject: Re: Parsing non-delimited text file It is really easy to re-factor from array based to file based. Change the first three lines of your code to this... def getcust(file_name) custs = [] IO.foreach(file_name) do |fl| Then update your calling code to pass the method a file name rather than an array. The rest of your method can be used as is. > I didn't look into foreach() yet, I feel that I need to get these > regexps in order first. > > def getcust(arr) >   custs = [] >   arr.each do |fl|