Hi
I have a question to ask regarding printing array outside of the loop.
let say i have multiple files such as F1 , F2 , F3 etc
in each files , i have a similar PATTERN such as below:
See asfdfdfd
#ERRORS
pattern to grep
pattern to grep
CELLS
cellpattern
abcdef
gfghtht
i would like to grep all the lines between #ERRROR and cellpattern.(including both #ERROR and cellpattern)
next, i would like to print out each pattern outside of my foreach loop(used to loop all files) so it will becomes like this:
output:
bla bla bla ( different result from other code)
bla bla bla ( different result from other code)
bla bla bla ( different result from other code)
#ERRORS <------------ from file F1
pattern to grep
pattern to grep
CELLS
cellpattern
#ERRORS <------------ from file F2
pattern to grep
pattern to grep
CELLS
cellpattern
the way my code is written print them out as they parse the line which
+ is not what i want . example of my current result
bla bla bla
#ERRORS <------------ from file F1
pattern to grep
pattern to grep
CELLS
cellpattern
bla bla
bla bla
#ERRORS <------------ from file F2
pattern to grep
pattern to grep
CELLS
cellpattern
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.