Hi all, I am struggling to write a program in which i have to read 2 diferent type of loops from many .doc files. These files consist of data as
data1; if(some condition1 = 1) then read this data 2; end if; if (some condition2 = 0) then read this data 3; read data 4; end if; if(some condition3 = 11) then read this data 5; data 6; end if; if (some condition2 = 0) then read this data 6; end if;
from which i have to read some data I am trying to check only for condition 2 and thus to get the output:
read this data 3; read data 4; read this data 6;
I wrote a prog to read the only condition 2 and try to read multiple files as:
open(WORDLIST, <*.doc>); while(<WORDLIST>) if(/if/) { if(/condition 2/) {print "$_"; } else{} } open(WORDLIST);
Am not able to read the desired output lines nor able to read multiple files. If a write a file name eg open(WORDLIST, <test.doc>); then am able to access one file at a time. Could u guys please help me.. Thanking u in advance...

In reply to read different loops by sharan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.