I just reread your post, and I think I mis-understood your request. The udfs I suggested still apply but you will probably want to split() out the fields you need.

 Code:
for each $line in wshpipe('netstat',1)
  if instr($line,"WhatEverYouAreLookingFor")
    $Var=split($line," ")[3]  ; arrays are 0 based so this would be the 4th item
  endif
next