R
raodeepak
Hi,
I'm a noob to perl and programming in general ( Have done basic C
Programming 4 years ago) but I need some help getting started.
My pseudo code is this
Firstly the given file has to be scanned row by row.
On finding the keyword "New Order", it has to start building a hash.
Let us say that the program encounters the first "New Order".
It has to then build a hash and the value of the key is the value of
the parameter - orderid
So under this key called orderid we should store the following values
for example from the text file input;
prodIdDD
cntrClasCod: P
cntrExpYrDat:2006
cntrExpMthDat: 06
cntrExerPrc: 00043
cntrVersNo: 0
ordrQty: +000000000015
buyCod: B
ordrExePrc: +0000000000350
ordrResCod: I
opnClsCod: O
ordrExpDat:
acctTypCod: M
acctTypNo: 1
userOrdrNum: 123456tttter (THIS IS WHAT THIS ENTIRE GROUP OF DATA
SHOULD BE CALLED)
ordrRmngQty: +000000000000
ordrExeQty: +000000000015
ordrExePrc: +0000000000350
ordrNo: 669382866
ordrTrnTypId: 050
userOrdrNum:123456tttter
PLEASE NOTE THAT THE VALUE AFTER THE COLON SHOULD BE SCANNED AND
ENTERED INTO THE CORRESPONDING VARIABLE.
FOR EXAMPLE $USERORDRNUM -->123456tttter
This should be a hash so that for the given datastructure i can call
this group of data, in this example "123456tttter" and get the
appropriate values like $ordrExeQty and so on.
This process should be carried on until it hits the next "New order"
upon which it has to do the same thing again, only thing that will
change is the name of the group of data to a different userordrnum and
the corresponding values to the ones for this group. I could then print
out this hash to a text file.
I hope this helps. Maybe this looks confusing but just think of it as
many instances of the keyword saying "human being". under human being
there is age, weight, date of birth, name etc. I want to store the
values and give this group of values the name of the human being. So
when I say Mike, i should get all your data or whatever i want.
I know this is a lot to ask for, I've read 60% of learning perl and i
kinda know what i should do (pattern matching?) but am quite lost. Any
help would be appreciated
Thanks
Deepak
I'm a noob to perl and programming in general ( Have done basic C
Programming 4 years ago) but I need some help getting started.
My pseudo code is this
Firstly the given file has to be scanned row by row.
On finding the keyword "New Order", it has to start building a hash.
Let us say that the program encounters the first "New Order".
It has to then build a hash and the value of the key is the value of
the parameter - orderid
So under this key called orderid we should store the following values
for example from the text file input;
prodIdDD
cntrClasCod: P
cntrExpYrDat:2006
cntrExpMthDat: 06
cntrExerPrc: 00043
cntrVersNo: 0
ordrQty: +000000000015
buyCod: B
ordrExePrc: +0000000000350
ordrResCod: I
opnClsCod: O
ordrExpDat:
acctTypCod: M
acctTypNo: 1
userOrdrNum: 123456tttter (THIS IS WHAT THIS ENTIRE GROUP OF DATA
SHOULD BE CALLED)
ordrRmngQty: +000000000000
ordrExeQty: +000000000015
ordrExePrc: +0000000000350
ordrNo: 669382866
ordrTrnTypId: 050
userOrdrNum:123456tttter
PLEASE NOTE THAT THE VALUE AFTER THE COLON SHOULD BE SCANNED AND
ENTERED INTO THE CORRESPONDING VARIABLE.
FOR EXAMPLE $USERORDRNUM -->123456tttter
This should be a hash so that for the given datastructure i can call
this group of data, in this example "123456tttter" and get the
appropriate values like $ordrExeQty and so on.
This process should be carried on until it hits the next "New order"
upon which it has to do the same thing again, only thing that will
change is the name of the group of data to a different userordrnum and
the corresponding values to the ones for this group. I could then print
out this hash to a text file.
I hope this helps. Maybe this looks confusing but just think of it as
many instances of the keyword saying "human being". under human being
there is age, weight, date of birth, name etc. I want to store the
values and give this group of values the name of the human being. So
when I say Mike, i should get all your data or whatever i want.
I know this is a lot to ask for, I've read 60% of learning perl and i
kinda know what i should do (pattern matching?) but am quite lost. Any
help would be appreciated
Thanks
Deepak