D
Deepu
Hi All,
I have a problem and i am not able to get what might be a better way of
solving this. Can somebody please give me some ideas on solving this.
I have a file which have transitions like:
STATE1
STATE3
STATEMAIN ####
STATESUSPEND
STATE1
STATE2
STATERESUME
RESET
STATE6
STATE8
STATEMAIN ####
STATE9
STATE10
This indicates a transition from STATE1 to STATE3, then STATE3 to
STATEMAIN and so on. There are also 10 files which will have different
combinations of these states.
Here i need to go through the file and check for STATEMAIN and when i
see STATEMAIN, then i need to put it in an array till i see RESET or
end of file. After that again i need to proceed further to check
whether there is any more STATEMAIN. If present again i need to put it
in a different array till RESET or end of file.
I need to store it in an hash:
%hash = (
FILE1 => ["STATEMAIN", "STATESUSPEND", "STATE1",
"STATE2", "STATERESUME", "RESET"],
FILE1 => ["STATEMAIN", "STATE9", "STATE10"],
FILE2 => - - - - -
);
and also if there is no STATEMAIN in any file there is no need of
putting in the hash.
Please help me on this.
Thanks
Deep
I have a problem and i am not able to get what might be a better way of
solving this. Can somebody please give me some ideas on solving this.
I have a file which have transitions like:
STATE1
STATE3
STATEMAIN ####
STATESUSPEND
STATE1
STATE2
STATERESUME
RESET
STATE6
STATE8
STATEMAIN ####
STATE9
STATE10
This indicates a transition from STATE1 to STATE3, then STATE3 to
STATEMAIN and so on. There are also 10 files which will have different
combinations of these states.
Here i need to go through the file and check for STATEMAIN and when i
see STATEMAIN, then i need to put it in an array till i see RESET or
end of file. After that again i need to proceed further to check
whether there is any more STATEMAIN. If present again i need to put it
in a different array till RESET or end of file.
I need to store it in an hash:
%hash = (
FILE1 => ["STATEMAIN", "STATESUSPEND", "STATE1",
"STATE2", "STATERESUME", "RESET"],
FILE1 => ["STATEMAIN", "STATE9", "STATE10"],
FILE2 => - - - - -
);
and also if there is no STATEMAIN in any file there is no need of
putting in the hash.
Please help me on this.
Thanks
Deep