NEED HELP CHANGING FORMAT OF OUTPUT FROM TWO LINES FOR EACH BLOCK OF DATA READ TO ONE LINE OF OUTPUT. Using C-Shell
THIS IS WHAT I GET: OUTPUT IS SPLIT INTO TWO LINES
ws8 94% awk -f /usr/tmp/get_par.awk DATA.par
AS HARDDEF
SPAR VEH ALARM HEARTBEAT
AS COMMAND
SPAR VEH ALARM HEARTBEAT
RV HARDDEF
SPAR VEH ALARM HEARTBEAT
THIS IS WHAT I WANT:
AS HARDDEF SPAR VEH ALARM HEARTBEAT
AS COMMAND SPAR VEH ALARM HEARTBEAT
RV HARDDEF SPAR VEH ALARM HEARTBEAT
ws8 95% cat /usr/tmp/get_par.awk
/@NAME:/ {print (substr($0,8,2)) " " (substr($0,35,7))};
{if (/@DESC:/) {print substr($0,8,25)} }
SAMPLE DATA
ws8 96% cat DATA.par
@VERSION_NUM: 1.13
@JITTER_VAL: 15 @MATH_TRIG:
@NAME: ASALARM_HB @STREAM: HARDDEF
@DESC: SPAR VEH ALARM HEARTBEAT @UNITS: BI-LVL
@DATAQ_CC
@ENABLE_LIMITS: NO
@PROC_LOC: FRONT END @FEND_NO: 1 @TIME_FMT: BINARY
@RAW_COMP: NONE
@RAW_CONV: IEEE FP
@EU_CAL: NULL
@EU_COMP: NONE
@YEL_LO: -9.8e+05 @YEL_HI: 9.8e+05 @RED_LO: -9.8e+05 @RED_HI: 9.8e+05
@DYN_LIMS: INACTIVE
@FMT: FLOAT @RES: 3
@NAME: ASALARM_HBT_CS @STREAM: COMMAND
@DESC: SPAR VEH ALARM HEARTBEAT ENABLE CMD ST @UNITS: CMD ST
@DATAQ_CC
@EU_CAL: NULL
@FMT: FLOAT @RES: 3
@NAME: RVALARM_HBT_SS @STREAM: HARDDEF
@DESC: SPAR VEH ALARM HEARTBEAT SCRIPT STATUS @UNITS: DSCRTE
@DATAQ_CC
@ENABLE_LIMITS: NO
@PROC_LOC: FRONT END @FEND_NO: 1 @TIME_FMT: BINARY
@RAW_COMP: NONE
@RAW_CONV: IEEE FP
@EU_CAL: NULL
@EU_COMP: NONE
@YEL_LO: -9.8e+05 @YEL_HI: 9.8e+05 @RED_LO: -9.8e+05 @RED_HI: 9.8e+05
@DYN_LIMS: INACTIVE
@FMT: FLOAT @RES: 3
THIS IS WHAT I GET: OUTPUT IS SPLIT INTO TWO LINES
ws8 94% awk -f /usr/tmp/get_par.awk DATA.par
AS HARDDEF
SPAR VEH ALARM HEARTBEAT
AS COMMAND
SPAR VEH ALARM HEARTBEAT
RV HARDDEF
SPAR VEH ALARM HEARTBEAT
THIS IS WHAT I WANT:
AS HARDDEF SPAR VEH ALARM HEARTBEAT
AS COMMAND SPAR VEH ALARM HEARTBEAT
RV HARDDEF SPAR VEH ALARM HEARTBEAT
ws8 95% cat /usr/tmp/get_par.awk
/@NAME:/ {print (substr($0,8,2)) " " (substr($0,35,7))};
{if (/@DESC:/) {print substr($0,8,25)} }
SAMPLE DATA
ws8 96% cat DATA.par
@VERSION_NUM: 1.13
@JITTER_VAL: 15 @MATH_TRIG:
@NAME: ASALARM_HB @STREAM: HARDDEF
@DESC: SPAR VEH ALARM HEARTBEAT @UNITS: BI-LVL
@DATAQ_CC
@ENABLE_LIMITS: NO
@PROC_LOC: FRONT END @FEND_NO: 1 @TIME_FMT: BINARY
@RAW_COMP: NONE
@RAW_CONV: IEEE FP
@EU_CAL: NULL
@EU_COMP: NONE
@YEL_LO: -9.8e+05 @YEL_HI: 9.8e+05 @RED_LO: -9.8e+05 @RED_HI: 9.8e+05
@DYN_LIMS: INACTIVE
@FMT: FLOAT @RES: 3
@NAME: ASALARM_HBT_CS @STREAM: COMMAND
@DESC: SPAR VEH ALARM HEARTBEAT ENABLE CMD ST @UNITS: CMD ST
@DATAQ_CC
@EU_CAL: NULL
@FMT: FLOAT @RES: 3
@NAME: RVALARM_HBT_SS @STREAM: HARDDEF
@DESC: SPAR VEH ALARM HEARTBEAT SCRIPT STATUS @UNITS: DSCRTE
@DATAQ_CC
@ENABLE_LIMITS: NO
@PROC_LOC: FRONT END @FEND_NO: 1 @TIME_FMT: BINARY
@RAW_COMP: NONE
@RAW_CONV: IEEE FP
@EU_CAL: NULL
@EU_COMP: NONE
@YEL_LO: -9.8e+05 @YEL_HI: 9.8e+05 @RED_LO: -9.8e+05 @RED_HI: 9.8e+05
@DYN_LIMS: INACTIVE
@FMT: FLOAT @RES: 3