#!/usr/bin/env ruby
$contents = Array.new
def readfile(filename)
if not File.exist? filename
puts "ErrorCode: 1"
exit 1
end
begin
File.open(filename) do |file|
file.each do |line|
s_line = line.split('\t')
puts s_line
points = s_line[3].delete(' ').split(',')
s_line = s_line.pop
s_line.push(points)
$contents.push(s_line)
end
end
rescue Exception => e
puts "Exception occured: ", e
end
end
def processfile
end
readfile "file"
processfile
IyEvdXNyL2Jpbi9lbnYgcnVieQoKJGNvbnRlbnRzID0gQXJyYXkubmV3CgpkZWYgcmVhZGZpbGUoZmlsZW5hbWUpCglpZiBub3QgRmlsZS5leGlzdD8gZmlsZW5hbWUKCQlwdXRzICJFcnJvckNvZGU6IDEiCgkJZXhpdCAxCgllbmQKCgliZWdpbgoJCUZpbGUub3BlbihmaWxlbmFtZSkgZG8gfGZpbGV8CgkJCWZpbGUuZWFjaCBkbyB8bGluZXwKCQkJCXNfbGluZSA9IGxpbmUuc3BsaXQoJ1x0JykKCQkJCXB1dHMgc19saW5lCgkJCQlwb2ludHMgPSBzX2xpbmVbM10uZGVsZXRlKCcgJykuc3BsaXQoJywnKQoJCQkJc19saW5lID0gc19saW5lLnBvcAoJCQkJc19saW5lLnB1c2gocG9pbnRzKQoJCQkJJGNvbnRlbnRzLnB1c2goc19saW5lKQoJCQllbmQKCQllbmQKCXJlc2N1ZSBFeGNlcHRpb24gPT4gZQoJCXB1dHMgIkV4Y2VwdGlvbiBvY2N1cmVkOiAiLCBlCgllbmQKZW5kCgpkZWYgcHJvY2Vzc2ZpbGUKCmVuZAoKcmVhZGZpbGUgImZpbGUiCnByb2Nlc3NmaWxl