Hi Monks,
I will be grateful if you can provide me a code for this problem. I am new to perl and you help will be really appreciated. I have a log file which looks like this:- (I have numbered the lines)
1 Software Package: "xxxxxxx"
2 Operation: install
3 Mode: not-transactional,not-undoable | force
4 Time: XXXXXXX
5 =================
6 WORKSTATION1:
7
8 Distribution ID: `xxxx.xxx'
9
10 Current software package status is 'IC--E'.
11
12 Operation successful.
13
14 Execution of user program 'during_install - C:\Staging\MS07-061_WXP_ENU.1.0.1.0\setup.exe (/s)' completed with result: 'success'.
15
16 User program exit code: 0
17
18
19 =================
20
21 Software Package: "XXXXX"
22 Operation: install
23 Mode: not-transactional,not-undoable |force
24 Time: XXXXXX
25 =================
26 WORKSTATION2:
27
28 Distribution ID: `XXXXX.XXXX'
29
30 Current software package status is 'IC--E'.
31
32 Operation unsuccessful.
33
34 Execution of user program 'during_install - C:\Staging\MS07-061_WXP_ENU.1.0.1.0\setup.exe (/s)' completed with result: 'success'.
35
36 User program exit code: 0
37
38
39 =================
40 and so on follows the same pattern.
### Program will find for the match 'IC--E'
The output file will look like this:
WORKSTATION1(Line 6) User program exit code: 0(Line 16)
WORKSTATION2(Line 26) User program exit code: 0(Line 36)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.