Skip to content

Instantly share code, notes, and snippets.

@vrybas
Created February 24, 2010 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vrybas/313195 to your computer and use it in GitHub Desktop.
Save vrybas/313195 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
@log_entries = Array.new
IO.foreach(ARGV[0]) do |line|
date,start_time,end_time,task,comments,duration = line.scan(/(?:^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)/).flatten
@log_entries << "#{date.chomp}\t#{duration.chomp.gsub('.',',')}\t#{task.chomp}"
end
puts @log_entries[1..-2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment