首先拆分從多條線路的多個DATAS,我有以下數據:如何在Perl
********************************************************************* TEST CASE ********************************************************************* test results for the last 1 run(s) TEST TITLE GROUP PRIO R-STAT R-TIME VERDICT VERDICT-TEXT ------------------------- ---------------------------------------- -------- ---- ------ ------------ -------- -------------------------------------------------- TESTCASE1 TC1 ABC 1 PASS 00:00:09.572 PASS nothing TESTCASE2 TC2 DEF 2 PASS 00:00:01.650 PASS nothing ---------------------------------------------------------------------------------------------------- NUMBER OF : 2 NUMBER OF TC: 2 ********************************************************************* VERDICT: PASS *********************************************************************
我想執行行:
TESTCASE1 TC1 ABC 1 PASS 00:00:09.572 PASS nothing TESTCASE2 TC2 DEF 2 PASS 00:00:01.650 PASS nothing
和分割第一行和最後線。
我該怎麼做?
補充:
對不起,來不及回覆,我想拆
*********************************************************************
TEST CASE
*********************************************************************
test results for the last 1 run(s)
TEST TITLE GROUP PRIO R-STAT R-TIME VERDICT VERDICT-TEXT
------------------------- ---------------------------------------- -------- ---- ------ ------------ -------- --------------------------------------------------
只是處理兩行
TESTCASE1 TC1 ABC 1 PASS 00:00:09.572 PASS nothing
TESTCASE2 TC2 DEF 2 PASS 00:00:01.650 PASS nothing
i use while loop to check line by line, the problem is it will be looped all of lines whereas i want two lines only.
這不是很清楚對我來說,你正在嘗試做什麼。你能解釋一下嗎? –
不確定「執行」是什麼意思?我將遍歷每一行併爲「TESTCASE」執行正則表達式匹配。 –
你是否想要在這些行上分割TEST和VERDICT-TEXT字段? – hwnd