Skip to content

Instantly share code, notes, and snippets.

@h2onda
Last active August 29, 2015 14:26
Show Gist options
  • Save h2onda/552399b6ac8db19c9edb to your computer and use it in GitHub Desktop.
Save h2onda/552399b6ac8db19c9edb to your computer and use it in GitHub Desktop.
separate crash log
#!/usr/bin/env ruby
ARGF.read.split(/crash>/).each_with_index{|str,idx|
open("%02g%s.log" % [idx, str.lines[0].gsub(" ","_").chomp], "w"){|file|
file << "crash>" << str
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment