Script Help



Hello,

I'm a definite newbie when it comes to perl and I need help with a
script to do the following:

Open a file named adapter.cfg

The file contains multiple stanza's and sub-stanza's. A stanza is
defined in the following:

File_Def #Beginning of Stanza1
Pattern_Def #Beginning of Sub-stanza 1
End_Pattern #End of Sub-stanza 1
Pattern_Def #Beginning of Sub-stanza 2
End_Pattern #End of Sub-stanza 2
Pattern_Def #Beginning of Sub-stanza 3
End_Pattern #End of Sub-stanza 3
End_File #End of Stanza

Within the File_Def there are 4 lines of definition
Within the Pattern_Def there are 10-14 lines of definition.
Within each File_Def there can be one or multiple Pattern_Def's.
Each File can have multiple File_Def's

The script needs to read in two or more variables to match. The first
variable will always be the File_Def and the Second and so on will be
the Pattern_Def to match.

So...
Read file
if Variable1 = True
then search for Variable2 within Stanza1
if Variable2 = True
then search for Variable3 within Stanza1
If Variable2 != True then Delete Stanza1
If Variable3 = True then search for Variable4 in Stanza1
If Variable3 != True then Delete Substanza1 and Substanza2
End


I know this seems a little complex but I have about 3500 files to sift
through and this seems like the logical method of going about doing it.
I just need a little direction.

Thanks,

Rick

.



Relevant Pages