Created
March 10, 2010 03:00
-
-
Save anonymous/327468 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This my output_buffer that needs to be parsed and presented in a 3D Hash. | |
groupid fnam lname bday | |
1 abc xyz jan1 | |
def lmn feb1 | |
2 amy morgan may1 | |
nick cary may6 | |
Here is a sample code.. | |
begin | |
test = Hash.new | |
test[port] = Hash.new | |
test[port].store(type, Hash.new) | |
mybuffer.each { |line| | |
groupid <- 1 | |
fname <- 'abc' | |
lname <- 'xyz' | |
bday <- 'jan1' | |
test = {groupid=>{fnam=>{"lname"=>lname, "bday"=>bday}}} | |
} | |
puts " FINAL HASH-- #{test} " | |
end | |
--------> When I print the final hash; I get only the last line [ nick cary may6] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment