The Script...
#!/usr/bin/perl #<"SplitFile.pl"> Split File undef $/; $OPTION=$ARGV[0]; $SEARCH=$ARGV[1]; $FLNAME=$ARGV[2]; $pid = open(XFILE, $FLNAME) or die "Couldn't fork: $!\n"; @finfo=split(/(\n\n)/, <XFILE>); $tRecsInfo = @finfo; @MATCHING = (); if ( $OPTION eq "with" ) { @MATCHING = grep /$SEARCH/i, @finfo; } else { @MATCHING = grep !/$SEARCH/i, @finfo; } $tMATCHING = @MATCHING; print "@MATCHING"; #print "\nI read ", scalar(@finfo), " RECORDS\n"; print "\nI read ", $tRecsInfo, " RECORDS\n"; print "I Selected ", $tMATCHING, " RECORDS\n";
The File ...
rrliupau:*:885:999:RRID - Paul Liu:/home/support/rrliupau:/usr/bin/ksh rrliupau ^rr in ID rrliupau RRID in Desc rrliupau Hard Link to Profile rrliupau Hard Link to Standard RRID Profile rrliupau Size 1078 Standard RRID Profile rrliupau RRID MultiSelect -r || exit 1 rrliupau 2974 -r-xr-xr-x 113 root support 1078 Jun 23 +2007 /home/support/rrliupau/.profile rrliupau slogint=Mon Jul 27 19:33:39 2009, lockout=0000000 rrdanilh:*:892:999:RRID - Nataliya Danilchenko:/home/support/rrdanilh: +/usr/bin/ksh rrdanilh ^rr in ID rrdanilh RRID in Desc rrdanilh Hard Link to Profile rrdanilh Hard Link to Standard RRID Profile rrdanilh Size 1078 Standard RRID Profile rrdanilh RRID MultiSelect -r || exit 1 rrdanilh 2974 -r-xr-xr-x 113 root support 1078 Jun 23 +2007 /home/support/rrdanilh/.profile rrdanilh slogint=Tue Jul 21 15:51:07 2009, lockout=0000000 rrtrthki:*:904:999:RRID - Kim Thanh-Tran:/home/support/rrtrthki:/usr/b +in/ksh rrtrthki ^rr in ID rrtrthki RRID in Desc rrtrthki Hard Link to Profile rrtrthki Hard Link to Standard RRID Profile rrtrthki Size 1078 Standard RRID Profile rrtrthki RRID MultiSelect -r || exit 1 rrtrthki 2974 -r-xr-xr-x 113 root support 1078 Jun 23 +2007 /home/support/rrtrthki/.profile rrtrthki slogint=Tue Jul 21 19:58:15 2009, lockout=0000000
I want the output to include the blank line. Thanx much

In reply to Include Delimiter in Split Output by Saved

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.