Well, Arrays are ordered by nature. (Hashes shouldn't be considered so).
That particular Hash was the first element of an Array.
So, it was the "0" element.
Look.
var = [ "first", 2, { :third => 3, :not_third => true}]
var[0] #=> "first" (a String)
var[1] #=> 2 (a Fixnum)
var[2] #=> {:third=>3, :not_third=>nil} (a Hash)
var[2][:third] #=> 3 (The :third key of that Hash is pointing to the Fixnum 3)
var[2][:not_third] #=> true
4000 lines?!
I strongly agree with Josh.
You should use another kind of data representation.
If you have no choice with the input data, you can (recursively) parse
it and transform it into something human readable.
Abinoam Jr.
On Mon, Jan 17, 2011 at 9:33 PM, Kamarulnizam Rahim
<niezam54 / hotmail.com> wrote:
> Hi Abinoam Jr,
>
> How do you know the hash inside it is indexed 0? This is because the
> rest of the outputs consist of nearly 4000 lines. Thus, locating
> contents wil be very difficult if i dnt know how to find it. Thanks
>
> Nizam
>
> --
> Posted via http://www.ruby-forum.com/.
>
>