while line = gets
	# Airline,flight#,AirportFrom,FromCode,AirportTo,ToCode,...\n
        # Example line: UA,5209,ZRH,1678,ORD,3830,Y,0,333
	if line =~ /^(\w+),(\d+),([A-Z]+),(\d+),([A-Z]+),(\d+)/
		flight_num = sprintf "%s%d", $1, $2
		from = $3
		to = $5
		depart = $4
		arrive = $6

		puts "Flight #{flight_num} departs #{from}, arrives in #{to}"
	end
end
