From: bobx@... (Bob) Date: 2002-03-09T11:53:11+09:00 Subject: Re: Text stuff and appending to a file > That's quite a large file. Instead of reading everything to memory, > how about reading one line at a time: > > # create a file to append data found from the input file > logfile = File.open("badwords.txt", "w+") > # search for a word and print the entire line > File.open(ARGV[0]) { |file| > file.each_line { |line| > if /bob/i =~ line > print line > logfile.write line > end > } > } > > Also consider using ruby 1.7 which has a much improved IO from what I > heard. > > YS. Well not being a programmers programmer and on Windows 1.7 is out of reach for me. I humbly rely on Andy for his rollup and I even give bug reports from time to time. : ) But...time is not an issue for me when reading the file so I can wait.