From: Expert Alart Date: 2013-07-24T07:14:53+09:00 Subject: Re: how to create structure like bellow Hi thanks you are right, i might be thinking too hard .. may be it can be done easily ... but still i am in puzzle ... The value will come from a file , its has raw data like bellow xx-xx-xx-xx-a-z16d1 xx-xx-xx-xx-b-z16d1 ................................... xx-xx-xx-xxx-b-z15a7 xx-xx-xx-xxx-b-z15a7 ................................... So to avoid mistakes i will have a manual entry , example there will be 8 Groups z16,z15,z1f........z1d as you can see those lines in file has those entry so i need to have like this z16 xx-xx-xx-xx-a-z16d1 xx-xx-xx-xx-b-z16d1 z15 xx-xx-xx-xxx-b-z15a7 xx-xx-xx-xxx-b-z15a7 Now run a loop to do snmp like for z15 , go each list power=`snmp xx-xx-xx-xxx-b-z15a7` total=power+toal end so the same for rest 8 .. to make it simple ... i am just planning to have array where i will insert those number manually.. object={z16,z15....z1d} now object.each do |obj| Read from the file if line entry has "z16" power=`snmp xx-xx-xx-xx-a-z16d1` power_total=power+total_power end store this value into z16 end So when i will represent the value in report it will be Total power for Z16=12 Total power for Z13 =12 .................................. ........................... may be can be done more simple -- Posted via http://www.ruby-forum.com/.