$ 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) Enterprise_VO |1|0 Users of Fusion: (Total of 4 licenses issued; Total of 0 licenses in use) Fusion |4|0 Users of Galaxy-AdvCTS: (Total of 5 licenses issued; Total of 0 licenses in use) Galaxy-AdvCTS |5|0 Users of Galaxy-AdvTech: (Total of 5 licenses issued; Total of 0 licenses in use) Galaxy-AdvTech |5|0 Users of Galaxy-Common: (Total of 30 licenses issued; Total of 1 license in use) Galaxy-Common |30|1