Hello Expert,
I have a file in the following format:
SYNTAX_VERSION 5
MONITOR "NAME_TEMPLATES"
DESCRIPTION "Monitors for contents of error "
INTERVAL "1m"
MONPROG "script.sh NAME_TEMPLATES"
MAXTHRESHOLD
GEN_BELOW_RESET
SEVERITY Major
APPLICATION "script.sh"
MSGGRP "MSG"
MSGCONDITIONS
DESCRIPTION "Has NEW errors"
CONDITION_ID "00000-34dc-25e0-1cfe-0a088b060000"
CONDITION
OBJECT "<#>diff<*.folder>"
THRESHOLD 0.500000
RESET 0.500000
SET
OBJECT "<$OPTION(area)>"
TEXT "There have been new failures Processing the <$OPTION(area)>
file on Central.
AUTOACTION "ls <folder>" ANNOTATE
HELPTEXT "OPS
=========
Please call support team"
HELP "0d152f3c-59dc-71e0-1cfe-0a034b060000"
DESCRIPTION "Has ANY errors"
CONDITION_ID "d26dda06-55f2-71e0-0025-0a034b060000"
CONDITION
OBJECT "<*.folder>"
THRESHOLD 0.500000
RESET 0.500000
SET
OBJECT "<$OPTION(area)>"
TEXT "There has been a failure Processing the <$OPTION(area)> file
HELPTEXT "OPS
=========
Please call out the support team"
others instruction
others instruction
HELP "0d152f3c-59dc-71e0-1cfe-0a034b060000"
I would like to transform it in .csv or .xls file.
I did the following command
1)
<more filename>| awk -F\" '{print $1","$2}'> /tmp/monitor.csv
2) But I need to show in two field also the rows without double quote:
THRESHOLD 0.500000
RESET 0.500000
3) Further (and this is more complicate to achieve) I need the part of this file after HELPTEXT and before HELP will be visualized in a unique row:
HELPTEXT "OPS
=========
Please call out the support team"
others instruction
others instruction
HELP "0d152f3c-59dc-71e0-1cfe-0a034b060000"
Is possible to achieve all these 3 steps with awk and in a unique script?
Thanks in advance for any help,
Ant-one