in reply to Perl solution

Alternatively, you can feed your script with the output of netstat -e opening a pipe:

use strict; use warnings; open NETSTAT, "netstat -e |" or die $!; while (<NETSTAT>){ # process the line # Output to csv } close NETSTAT;
citromatik