[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

File handling

Advait Bellur

12/24/2007 4:00:00 PM

Hi,

I have to make use of a single associative array to hold two files and I
should be able to access them in the following manner

1. ['<group name>'] to have info related to group
2 ['<group name>']['<subject>']
3 ['<group name>','<name>','<subject>']

The file, along with the two group are

abc.qq

Names sub1 sub2 sub3 sub4

zzz 22 32 40 10
. . . .
. . . .
9 Answers

Robert Klemme

12/24/2007 8:56:00 PM

0

On 24.12.2007 16:59, Advait Bellur wrote:
> Hi,
>
> I have to make use of a single associative array to hold two files and I
> should be able to access them in the following manner
>
> 1. ['<group name>'] to have info related to group
> 2 ['<group name>']['<subject>']
> 3 ['<group name>','<name>','<subject>']
>
> The file, along with the two group are
>
> abc.qq
>
> Names sub1 sub2 sub3 sub4
>
> zzz 22 32 40 10
> . . . .
> . . . .

From what you've written it's unclear to me

- whether you want an in memory structure or persistent data,

- what you have implemented so far,

- what it is that you are asking.

I'd say there is some room for improvement of your original posting. :-)

Kind regards

robert

Todd Benson

12/25/2007 3:57:00 AM

0

On Dec 24, 2007 3:00 PM, Robert Klemme <shortcutter@googlemail.com> wrote:
> On 24.12.2007 16:59, Advait Bellur wrote:
> > Hi,
> >
> > I have to make use of a single associative array to hold two files and I
> > should be able to access them in the following manner
> >
> > 1. ['<group name>'] to have info related to group
> > 2 ['<group name>']['<subject>']
> > 3 ['<group name>','<name>','<subject>']
> >
> > The file, along with the two group are
> >
> > abc.qq
> >
> > Names sub1 sub2 sub3 sub4
> >
> > zzz 22 32 40 10
> > . . . .
> > . . . .
>
> From what you've written it's unclear to me
>
> - whether you want an in memory structure or persistent data,
>
> - what you have implemented so far,
>
> - what it is that you are asking.
>
> I'd say there is some room for improvement of your original posting. :-)

I agree with robert. I think I know what you want to do, but just am not sure.

Todd

Advait Bellur

12/26/2007 8:17:00 AM

0

Todd Benson wrote:
> On Dec 24, 2007 3:00 PM, Robert Klemme <shortcutter@googlemail.com>
> wrote:
>> > The file, along with the two group are
>>
>> - whether you want an in memory structure or persistent data,
>>
>> - what you have implemented so far,
>>
>> - what it is that you are asking.
>>
>> I'd say there is some room for improvement of your original posting. :-)
>
> I agree with robert. I think I know what you want to do, but just am
> not sure.
>
> Todd




Hi,

I am really sorry for not describing by dought properly.

I have two files ABC.tvs and DEF.tvs, both these files house
student data as shown below

ABC.tvs
.......

Names Hindi English Mathematics
student1 90 75 80
student2 77 84 96
student3 85 84 89
student4 88 91 75

and the other file

DEF.tvs
.......
Hindi English Sanskrit Names Biology
90 75 80 student11 88
77 84 96 student12 84
85 84 89 student13 99
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

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
--
Posted via http://www.ruby-....

Robert Klemme

12/26/2007 10:43:00 AM

0

On 26.12.2007 09:17, Advait Bellur wrote:
> Todd Benson wrote:
>> On Dec 24, 2007 3:00 PM, Robert Klemme <shortcutter@googlemail.com>
>> wrote:
>>>> The file, along with the two group are
>>> - whether you want an in memory structure or persistent data,
>>>
>>> - what you have implemented so far,
>>>
>>> - what it is that you are asking.
>>>
>>> I'd say there is some room for improvement of your original posting. :-)
>> I agree with robert. I think I know what you want to do, but just am
>> not sure.
>>
>> Todd
>
>
>
>
> Hi,
>
> I am really sorry for not describing by dought properly.
>
> I have two files ABC.tvs and DEF.tvs, both these files house
> student data as shown below
>
> ABC.tvs
> ......
>
> Names Hindi English Mathematics
> student1 90 75 80
> student2 77 84 96
> student3 85 84 89
> student4 88 91 75
>
> and the other file
>
> DEF.tvs
> ......
> Hindi English Sanskrit Names Biology
> 90 75 80 student11 88
> 77 84 96 student12 84
> 85 84 89 student13 99
> 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_.

Kind regards

robert

MonkeeSage

12/26/2007 11:18:00 AM

0

On Dec 26, 4:43 am, Robert Klemme <shortcut...@googlemail.com> wrote:
> 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.

Regards,
Joordan

Todd Benson

12/27/2007 1:15:00 AM

0

On Dec 26, 2007 4:44 AM, Robert Klemme <shortcutter@googlemail.com> wrote:
>
> On 26.12.2007 09:17, Advait Bellur wrote:
> > 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_.
>
> Kind regards
>
> robert
>

I'm still not sure, but I think Advait wants to search for a line in a
file. Is that true, Advait?

Todd

Advait Bellur

12/27/2007 3:25:00 PM

0

Todd Benson wrote:
> On Dec 26, 2007 4:44 AM, Robert Klemme <shortcutter@googlemail.com>
> wrote:
>> >
>> Kind regards
>>
>> robert
>>
>
> I'm still not sure, but I think Advait wants to search for a line in a
> file. Is that true, Advait?
>
> Todd

Hi,

Ya thats right I want to search a line in the file
--
Posted via http://www.ruby-....

Jesus Christ the Holy Cunt Fucker

11/27/2013 6:42:00 PM

0

BaBoon


don 't trust TOO MUCH in the words of my disciples
because
my disciples were also fuckers .

my disciples also loved to fuck cunt holes .











On Wednesday, November 27, 2013 10:07:34 AM UTC-8, Baboe Belanda wrote:
> On Wed, 27 Nov 2013 09:36:57 -0800 (PST), "Jesus Christ Nothos copies
>
> Perseus , a God + Man" <veakrin@gmail.com> wrote:
>
>
>
> >BaBoon
>
> >
>
> >fucking Hell
>
> >
>
> >
>
> >
>
> >life is about fucking , BIG Butts ,Tits ,
>
> >
>
> >what 's more do you want ?
>
> >if you have cunt fucking , nice butts , and tits .
>
> >
>
> >
>
> >BaBoon is MAD .
>
> >
>
> "Do not give what is holy to the dogs; nor cast your
>
>
>
> pearls before swine, lest they trample them under their feet, and turn
>
>
>
> and tear you in pieces." Matthew 7:6
>
> >
>
> >
>
> >
>
> >
>
> >On Wednesday, November 27, 2013 9:03:26 AM UTC-8, Baboe Belanda wrote:
>
> >> If you want to learn about philosophy or logic, you ask me.
>
> >>
>
> >>
>
> >>
>
> >> But if you want to learn about female big butts and vibrators, go ask
>
> >>
>
> >> Yale Guen Mar, aka Rusty Wyse. Believe me, Wyse does not stand for
>
> >>
>
> >> Wise. He only knows about his girlfriends big butts and vibrators.
>
> >>
>
> >> Ask him if you want to know about those two specialties of Yale Guen
>
> >>
>
> >> Mar.
>
> >>
>
> >> ___________________________________
>
> >>
>
> >> "Do not give what is holy to the dogs; nor cast your
>
> >>
>
> >> pearls before swine, lest they trample them under their feet, and turn
>
> >>
>
> >> and tear you in pieces." Matthew 7:6
>
> ___________________________________
>
> "Do not give what is holy to the dogs; nor cast your
>
> pearls before swine, lest they trample them under their feet, and turn
>
> and tear you in pieces." Matthew 7:6

auwe digidauw

11/27/2013 9:25:00 PM

0

Baboe Belanda <baboebelanda@gmail.com> wrote in
news:j3dc999ajmit3dpaog2kdlv1la6oale54a@4ax.com:

>>
> "Do not give what is holy to the dogs; nor cast your
>
> pearls before swine, lest they trample them under their feet, and turn
>
> and tear you in pieces." Matthew 7:6



please stop positioning yourself as the swine then ,

stand up, have pride and dignity like human ! a civilized one !