I would like to process some data from an array and using hash to
perform a count on one aspect of the data in the array. The array holds
lines of similarly formatted data like so
data A data B data C data D data E data F
data A data B data C data D data E data F
data A data B data C data D data E data F
data A is the identifier of each row full of data, data F contains a lot
of data which requires a regular expression which is passed to a method
for example:
"#{data F[/Name:\t(.+?)\r\n/, 1]}"
I am stuck writing the hash section of the code. The alogorithm is
if data A == 100
load data F reg expression into hash
end
count data F to determine the number of each name extracted by the
regular expression
print bob 6, sue 12, tim 1
I hope this makes sense and many thanks in advance
···
--
Posted via http://www.ruby-forum.com/.