Heinrich Piard wrote: > Sebastian Hungerecker wrote: >> Mike McKinney wrote: >>> should do : >>> >>> ValidDate = File.readlines('someFile.txt').to_s.grep(/Not After/) >> >> Yes, and leave out the to_s, too. If you want a string use File.read >> instead >> of File.readlines. In this case you can use both, though, since String >> and >> Array both have a grep method. But using readlines to get an array and >> then >> converting it to string via to_s, doesn't make sense. >> >> HTH, >> Sebastian > > Thanks guys, > > I did include those changes in my code. > > bye > Henry Hi all, one more thing. I saw something in this forum about 'how to calculate time difference' , but I can't find it anymore. I want to calculate the time difference (in days): DateDiff = CertValidDate - actualDate but I get this error message: undefined method `-' for "2008-09-10":String (NoMethodError) bye Henry -- Posted via http://www.ruby-forum.com/.