I have a 30k line text file from which I need to extract and format the data as below:
object-group service name1 tcp
port-object eq 9284
port-object eq ssh
port-object range 13701 13784
object-group service name2 tcp
port-object range 14000 14021
port-object eq 1908
port-object eq ssh
There can be multiple lines below a single object-group service.
In some cases there is an additional line like description desc1 [would always start with word description]; we do not want this line; only lines starting with port-object to be listed.
application <name> term <number> protocol <protocol> destination-port <port>[-<range>]
application name1 term 1 protocol tcp destination-port 9284
application name1 term 2 protocol tcp destination-port ssh
application name1 term 3 protocol tcp destination-port 13701-13784
application name2 term 1 protocol tcp destination-port 14000-14021
application name2 term 2 protocol tcp destination-port 1908
application name2 term 3 protocol tcp destination-port ssh
Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx..
Use Unix file format while saving Your script.
otherwise it will have ^M s or smth likely weird in the EOL,
Then DO NOT use m…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions.
Consider email address RFCs:
Look at HTML5 form input element (with type=email) regex pattern: