Hi Monks... i am getting only one line output from the i/p file. the data below that is not printing from the input file , i/p file is given below & program
D Fri Nov 21 14:09:41 2008 TME_BILLING_COE cm:10570 cm_child.c(107) +:4385 1:blrdxp-santbs:CustomerCenter XXX CMAP: op_custom() past op_decode, opcode: PCM_OP_CUST D Fri Nov 21 14:09:41 2008 TME_BILLING_COE cm:10570 cm_child.c :92 +1:blrdxp-santbs:CustomerCenter:0:AWT-EventQueue-0:83:1227256900:0 op_cust_validate_customer input flist # number of field entries allocated 20, used 3 0 PIN_FLD_POID POID [0] 0.0.0.1 /plan -1 0 0 PIN_FLD_ACCOUNT_OBJ POID [0] 0.0.0.1 /account -1 0 0 PIN_FLD_PAYINFO ARRAY [1] allocated 20, used 5 1 PIN_FLD_NAME STR [0] "Invoice1" D Fri Nov 21 14:09:41 2008 TME_BILLING_COE cm:10570 fm_cust_pol_pre +p_payinfo.c:113 1:blrdxp-santbs:CustomerCenter:0:AWT-EventQueue-0:83: +1227256900:0 op_cust_pol_prep_payinfo input flist # number of field entries allocated 20, used 5 0 PIN_FLD_POID POID [0] 0.0.0.1 /payinfo/invoice -1 0 0 PIN_FLD_ACCOUNT_OBJ POID [0] 0.0.0.1 /account -1 0 0 PIN_FLD_FLAGS INT [0] 1 use strict; use warnings; my $input_file = $ARGV[0]; my $input_pid = $ARGV[1]; my $input_string = $ARGV[2]; print "Usage: test.pl <input file name> <input process id> <input file +string>" if (@ARGV != 3); open (my $hfile, '<', "$input_file") || die("Unable to open the file $ +input_file\n"); open (my $ofile, '>', "output.txt") || die("Unable to open the file ou +tput.txt\n"); while (<$hfile>){ my $line = $_; if ($line =~ /[DWEM]\s+.*?\s+(?:c|cm|M)\:($input_pid)\s+([^\.]+\.c +)/s) { my $c_file = $2; my $pid = $1; if($input_string eq $c_file){ #check with input string print $ofile "$line\n"; #write the output in a output file } } }
my input is perl test 10570 'cm_child.c' output i am getting is,
D Fri Nov 21 14:09:43 2008 TME_BILLING_COE cm:10570 cm_child.c(107) +:4385 1:blrdxp-santbs:CustomerCenter:0:AWT-EventQueue-0:63:1227256901 D Fri Nov 21 14:09:46 2008 TME_BILLING_COE cm:10570 cm_child.c(107) +:4385 1:blrdxp-santbs:CustomerCenter:0:AWT-EventQueue-0:3:1227256904:
Rest of the data is not coming .. the expected ouput is,
D Fri Nov 21 14:09:41 2008 TME_BILLING_COE cm:10570 cm_child.c(107) +:4385 1:blrdxp-santbs:CustomerCenter XXX CMAP: op_custom() past op_decode, opcode: PCM_OP_CUST D Fri Nov 21 14:09:41 2008 TME_BILLING_COE cm:10570 cm_child.c :92 +1:blrdxp-santbs:CustomerCenter:0:AWT-EventQueue-0:83:1227256900:0 op_cust_validate_customer input flist # number of field entries allocated 20, used 3 0 PIN_FLD_POID POID [0] 0.0.0.1 /plan -1 0 0 PIN_FLD_ACCOUNT_OBJ POID [0] 0.0.0.1 /account -1 0 0 PIN_FLD_PAYINFO ARRAY [1] allocated 20, used 5 1 PIN_FLD_NAME STR [0] "Invoice1"

In reply to output issue.... by jaggu_bg

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.