Dan Zwell wrote:
> Dan Daniels wrote:
>> end
>> end
>> end
>>
>>
>>
>> Any ideas or hints appreciated!
>> Dan
>
> What is logdatepattern, and what is its relation to logdate?
Apologies, I tried to pear down the post and left that out accidentally.
I had also tried:
logdatepattern = logdate
and
logdatepattern = logdate.to_s
Here is the original post, fixed:
This does not work:
logdate = "#{@calendar1.year}-" + (@calendar1.month + 1).to_s +
"-#{@calendar1.day}"
puts "Getting log for #{logdate}"
File.open("rdpconnect.log").each do |line|
if line.match(logdate)
puts line
end
end
However, this does:
logdate = "2007-07-30"
puts "Getting log for #{logdate}"
File.open("rdpconnect.log").each do |line|
if line.match(logdate)
puts line
end
end
The format of logdate appears the same in both instances. What am I
missing?
Thanks,
--
Posted via
http://www.ruby-forum.com/.