From: Lark Work Date: 2010-11-15T17:32:33+09:00 Subject: please help load from txt hi i new to this forum and i have a problem a made a script containing a load data from a file but i want it to load one line at the time the data from that line must be used but i don't know how i (and maybe if its possible i want to call a line with gets.chomp of something) so can u please help me this is my code : class Class_load def initialize(textfile) @text = IO.readlines(textfile) @data = [] for i in 0...@text.size @text[i].each(',') {|s| @data.push(s.delete(","))} end show_load_data end def load_data end def show_load_data puts "Name: #{@data[0]} #{@data[1]}" puts "Callname: #{@data[2]}" puts "Age: #{@data[3]}" end end Class_load.new("data.txt") and this is how my data.txt looks like: name,lastname,callname,age name2,lastname2,callname2,age2 etc so can somebody please help me???? -- Posted via http://www.ruby-forum.com/.