I'm brand new to perl and trying to solve a problem.. Here is what I'm
trying to do:
General: Within a directory I want to open every file ending in .nasl,
look for three strings and capture text after each string till I see a "
or ), then take that text and append it to a single file delineated by a
comma, tab, or | symbol.
More detailed:
Perform the following operations on every file ending in .nasl within
/tmp (attached is sample of file to be opened) with an extension of *.nasl
1. Search file for the following strings:
script_id(NNNNN);
script_cve_id("AAA-NNNN-NNNN");
name["english"] = "XXXXXXXXXXXXXXXXXXX";
2. Pull the text associated with the capitalized text above from each
file (listed below). I've put comments as to the data type.
NNNNN # integer (5) characters in length
AAA-NNNN-NNNN # alphanumeric text string Example: Always CVE-year-ID
or CAN-year-ID
XXXXXXXXX # text -- This is just the name of the script
3. output this to one file somehow delineated by a comma, tab or |:
NNNNN,AAA-NNNN-NNNN, XXXXXXXXX
NNNNN AAA-NNNN-NNNN XXXXXXXXX
NNNNN|AAA-NNNN-NNNN|XXXXXXXXX
4. I have attached a sample nasl file I'm parsing
below...................................................................................
thanks for your help!
If this is too lofty of a question to ask for help with, I understand.
wrap.nasl