0
Users of SSS:  (Total of 1 license issued;  Total of 0 licenses in use)

Users of DesignWare-Regression:  (Total of 1 licenses issued;  Total of
0 licenses in use)

Users of FusionVantageLmcInterface:  (Total of 2 licenses issued;
Total of 0 licenses in use)

Users of LMCSwift_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of SNPS-Assertions:  (Total of 4 licenses issued;  Total of 0
licenses in use)

Users of VCSAMSCompiler_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of VCSAMSRuntime_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of VCSPostProcDebugger_Net:  (Total of 2 licenses issued;  Total
of 0 licenses in use)

Users of VCSTools_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of VCSiCompiler_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of VCSiRuntime_Net:  (Total of 2 licenses issued;  Total of 2
licenses in use)

Users of VT_Assertions:  (Total of 4 licenses issued;  Total of 0
licenses in use)

Users of VT_AssertionsRuntime:  (Total of 2 licenses issued;  Total of
0 licenses in use)

Users of VT_Coverage:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of VT_CoverageRuntime:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of VT_CoverageURG:  (Total of 3 licenses issued;  Total of 0
licenses in use)

Users of VT_Testbench:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of VT_TestbenchRuntime:  (Total of 2 licenses issued;  Total of
2 licenses in use)


Users of VT_Visual:  (Total of 2 licenses issued;  Total of 2 licenses in use)

Users of XVCSDebugger:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of vera_comp:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of vera_debug:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of vera_rtime:  (Total of 2 licenses issued;  Total of 0 licenses in use)

我有这样的数据。在这个我想要产品名称,颁发的许可证数量,使用的许可证数量..我怎样才能得到它......请帮助

这就是我现在所拥有的。

    if ($_=~ m/.*users\s+of\s+(.*)\:\s+(Total\s+of\s+(\d)\s+licenses.*\;\A*\s+total\s+of\A*\‌​s+(\d)\A*\s+licenses\s+.*)/gmi)

{print "$1,$2,$3}";
4

1 回答 1

1

希望这符合您的需要。你忽略了某些方面,我已经修复了这些。

$Data = join '',<DATA>;
while ( $Data =~
    m/\G\s*Users\s*of\s*(.+?)\s*:
         \s*\(Total\s*of\s*(\d+)\s*licenses\s*issued\s*\;
         \s*Total\s*of\s*(\d+)\s*licenses\s*in\s*use\s*\)\s*/gmix)
     {
         print "$1,$2,$3\n";
     }
__DATA__
Users of vera_rtime:  (Total of 2 licenses issued;  Total of 0 licenses in use)

Users of DesignWare-Regression:  (Total of 1 licenses issued;  Total of
0 licenses in use)

Users of FusionVantageLmcInterface:  (Total of 2 licenses issued;
Total of 0 licenses in use)

Users of LMCSwift_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)


Users of SNPS-Assertions:  (Total of 4 licenses issued;  Total of 0
licenses in use)

Users of VCSAMSCompiler_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of VCSAMSRuntime_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)

Users of VCSPostProcDebugger_Net:  (Total of 2 licenses issued;  Total
of 0 licenses in use)

Users of VCSTools_Net:  (Total of 2 licenses issued;  Total of 0
licenses in use)
于 2013-07-08T11:53:53.953 回答