From: Sean Hussey Date: 2006-11-10T04:21:59+09:00 Subject: Spliting a line and passing the results Hi everone, I'm not quite sure what the best way to go about this is. I have a file with one user per line. Each line contains ID, username, phone, etc. I split all these up into variables and then either create a new user or update an existing user: File.open("users.txt", "r") do |file| file.each_line { |line| id, username, phone, lots, more, variables = line.chomp.split(/\|/); if user = ldap.get_entry(username) # Existing user. Check for update. user.update(I, hate, passing, all, of, the, variables, that, were, just, split) else # New user. Create! user.new(Same, here, see, what, I mean?) end } end Should I put it all into an array? Hash? Would that make the split line huge but save space on the method calls? How would you go about this? Thank you! Sean