From: Remington Splettstoesser Date: 2010-04-08T23:44:58+09:00 Subject: simple text parsing Hello Everyone, What is the best way to get this input test.txt ------------------------------------------------ David | Hansson | Chicago Obie | Fernandez | Jacksonville ------------------------------------------------ to this output: First Name: David Last Name: Hansson City: Chicago First Name: Obie Last Name: Fernandez City: Jacksonville ????????????????????????? This is what I've tried so far.. I'm pretty far off I believe. Any suggestions would help with learning the ins and outs of Ruby (or programming in general) ----------------------------- test.rb ---------------------------- myArray = [] file = File.open("test.txt", 'r+') file.each_line do |line| x = line.scan(/\w+/).inspect myArray = x puts myArray end my output ----------------------- $ ruby test.rb ["David", "Hansson", "Chicago"] ["Obie", "Fernandez", "Jacksonville"] Thanks in Advance Remington Splettstoesser