I'm having issues trying to create an AWK script which will fill in the missing rows from a file generated from Netstat and output to a new file
the Netstat output that I have captured has missing rows if no connection is made during that time period ...
for example
20200531170036
5 CLOSE_WAIT
349 ESTABLISHED
5 FIN_WAIT_2
1 TIME_WAIT
20200531170042
5 CLOSE_WAIT
356 ESTABLISHED
5 FIN_WAIT_2
20200531170047
4 CLOSE_WAIT
360 ESTABLISHED
2 TIME_WAIT
so I'd want it to display any missing rows with a 0 (see items in bold below )
Moderator : Now with code tags, required output change is enclosed with **, instead of bold.
20200531170036
5 CLOSE_WAIT
349 ESTABLISHED
5 FIN_WAIT_2
1 TIME_WAIT
20200531170042
5 CLOSE_WAIT
356 ESTABLISHED
5 FIN_WAIT_2
**0 TIME_WAIT**
20200531170047
4 CLOSE_WAIT
360 ESTABLISHED
**0 FIN_WAIT_2**
2 TIME_WAIT
so always displaying CLOSE_WAIT, ESTABLISHED, FIN_WAIT_2, TIME_WAIT on separate rows
Any suggestions how I can get this to work using AWK ?
many thanks