time displays the time in a separate file. It is necessary to intercept the line and forward it to the end of another file. I do not understand what the catch is ..
File.readlines('time.log', 'r') do |line| if line =~ /^real/ File.new('table.log', 'a').puts(line) end end What does not suit me is string trimming:
real 15,775 Only numbers are needed. I tried to prescribe the regulars in different ways. but they either didn’t work or brought out something strange
File.new('table.log', 'a').puts(line[0])