R
RichardOnRails
Hi,
I've got a text file with 7 fields. I successfully extract the data
on each with a regex and for debugging purposes print each lines
fields.
Now I want to edit and organize the data for subsequent processing.
But populating the hash fails. I posted the code on http://www.pastie.org/1468271
The "puts" on line 15 shows that the regex captures the 7 fields in
the text file.
Lines 17-19 is an attempt to build a hash using the known values in
the $n variables.
That attempt fails because line 21 shows that it's nil instead the
string 100.0000 reported by line 15.
Maybe I should just build an array of the extracted values and use the
symbols I've created to index the array. In the mean time, mainly
for my education, I'd like to know where I went wrong with this hash.
Thanks in Advance,
Richard
I've got a text file with 7 fields. I successfully extract the data
on each with a regex and for debugging purposes print each lines
fields.
Now I want to edit and organize the data for subsequent processing.
But populating the hash fails. I posted the code on http://www.pastie.org/1468271
The "puts" on line 15 shows that the regex captures the 7 fields in
the text file.
Lines 17-19 is an attempt to build a hash using the known values in
the $n variables.
That attempt fails because line 21 shows that it's nil instead the
string 100.0000 reported by line 15.
Maybe I should just build an array of the extracted values and use the
symbols I've created to index the array. In the mean time, mainly
for my education, I'd like to know where I went wrong with this hash.
Thanks in Advance,
Richard