I have a Perl parsing problem. I have to find a keyvalue for a KEYWORD KEYNAME.
I have a file containing KEYWORD KEYNAME on a line followed by keyvalue on a subsequent line
An added problem is that the file allows perl & shell type comments using # – e.g. everything after a # char until the end of the line is a comment. The file also allows blank lines between KEYWORD KEYNAME and keyvalue. Also, as long as KEYWORD and KEYNAME are on the same line there can be any amount of white space between KEYWORD and KEYNAME.
The good thing is that KEYWORD KEYNAME and keyvalue have to start the line
e.g. all the following are valid.
Example1 – I have to find the MACHINENAME value which is atab15
########## comment
KEYWORD MACHINENAME #comment
## comment
atab15 # comment
Example2 – I have to find the TARKETSYSTEM value sunSolaris
KEYWORD TARKETSYTEM
sunSolaris
Example3 – I have to find the HIHO value goodbye
KEYWORD HIHO
Goodbye
Any ideas?