For all intensive purposes the script should work however I have one tiny problem. I cannot seem to skip from one iteration to the next. It just carries on.
open my $in, '<', 'CLF17936.out';
open my $out, '>', "logfile.txt";
my $check = 0;
@lines = split('', $_);
$check += 1 if $lines eq 'h';
if($check%2 == 1)
if($lines eq 'j')
my $first = substr $_, 37, 20;
my $second = substr $_, 67, 3;
print $out "\n Name: $first\t ABICODE: $second\n";
if($lines eq 'k')
my $qstatus = substr $_, 113, 1;
if($qstatus ne "1")
print $out "FAIL\n";
if(($lines eq 'E') || ($lines eq 'G'))
print $out "$_";
It just needs to miss the last if statement if the above prints to $out as a FAIL. However in the out put file this is what I am getting
Name: B-D Z2 -10 ABICODE: 216
Can anyone advise if its just something I've missed?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||