$ perl -Mstrict -Mwarnings -e ' while (<>) { if(/^Users of ([\w+\_\-]):\s+\(Total of ([0-9]+) licenses issued;\s+Total of ([0-9]+) (licenses|license) in use/ ) { print "$1 |$2|$3 \n"; } else { print "No match!\n"; } } ' Users of Enterprise_VO: (Total of 1 license issued; Total of 0 licenses in use) No match! Users of Fusion: (Total of 4 licenses issued; Total of 0 licenses in use) No match! Users of Galaxy-AdvCTS: (Total of 5 licenses issued; Total of 0 licenses in use) No match! Users of Galaxy-AdvTech: (Total of 5 licenses issued; Total of 0 licenses in use) No match! Users of Galaxy-Common: (Total of 30 licenses issued; Total of 1 license in use) No match!