diff --git a/sorter.rb b/sorter.rb index 0f9ee69..5984462 100755 --- a/sorter.rb +++ b/sorter.rb @@ -152,8 +152,13 @@ def process_file (file_name, binfile, type) sections = text.lines("Date and time:", chomp: true) #sections is an arrary of each date section from the text sections.delete_at(0) #we can ignore the first chunk of text sections.each do |chunk| - timestamp = chunk.lines.delete_if {|line| line == "\r\n"}[0] #pulling out the timestamp - timestamp.tr!('/','-').tr!(':','').tr!(' ','_') #remove slashes and colons from timestamp, replaces spaces with unserscores + begin + timestamp = chunk.lines.delete_if {|line| line == "\r\n"}[0] #pulling out the timestamp + timestamp.tr!('/','-').tr!(':','').tr!(' ','_') #remove slashes and colons from timestamp, replaces spaces with unserscores + rescue + pp timestamp + abort + end timestamp.strip! output = Hash.new #Creating the output storage object outfile = file_name + '_' + timestamp