I’d say there is some room for improvement of your original posting.
I am really sorry for not describing by dought properly.
student3 85 84 89
88 91 75 student14 95
Now I need to put both these file into and array (single associative
array) and read them
simeltaneously meaning when I execute this program typing the
"group_name " followed by “student_name” I should get the result
What is a “group name”? I can guess on the student name but am at a
loss with regard to this “group name”.
ex
ABC student3
o/p => student3 85 84 89
similarly
DEF student12
o/p => 77 84 96 student12 84
How could I achieve this
Frankly, this looks like a homework assignment and I am reluctant to
implement this for you. Also it seems, the spec is not yet fully clear
(to you). So while we have a pretty good specification (or rather
example) of the input data, it is still not clear to me what output you
expect. You talk about putting your input data into a single
associative array which is implementation terminology. But the
important bit is to get the requirements straight first.
Also it seems, the spec is not yet fully clear
(to you).
That was my thought. It seems the OP wants treat two different streams
as the same kind of data (but keyed on different values). I can think
of a way to abstract this, but it just “feels” wrong. Seems like this
kind of thing is best suited to a DB/ORM mapping rather than trying to
do it by hand.
Now I need to put both these file into and array (single associative
array) and read them
simeltaneously meaning when I execute this program typing the
"group_name " followed by “student_name” I should get the result
ex
ABC student3
o/p => student3 85 84 89
similarly
DEF student12
o/p => 77 84 96 student12 84
How could I achieve this
Thanking you
ARB
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.