wusphere has asked for the wisdom of the Perl Monks concerning the following question:
thanks for all you helpmy $file = 'test.dat'; my $totalTxns = 0; my $maxSeg = 6; my $segOffset = 24; my $segSize = 240; open(INFILE, $file) or die "Can't read file\n"; while (<INFILE>) { $rectype = substr($_,0,1); if ($rectype eq 'C') { $offSet = $segOffset; for ($seg = 0; $seg < $maxSeg; $seg++) { $txn = substr($_,$offSet,$segSize); $totalTxns++ if($txn =~ /\S/); $offSet += $seqSize; } } }
janitored by ybiC: Balanced <code> tags around codeblock to allow easy download of code
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: numbers not adding up!
by pbeckingham (Parson) on Aug 07, 2004 at 23:09 UTC | |
by wusphere (Novice) on Aug 07, 2004 at 23:19 UTC | |
by pbeckingham (Parson) on Aug 07, 2004 at 23:25 UTC | |
by wusphere (Novice) on Aug 07, 2004 at 23:41 UTC | |
by pbeckingham (Parson) on Aug 08, 2004 at 00:00 UTC | |
by Popcorn Dave (Abbot) on Aug 08, 2004 at 18:15 UTC | |
| |
|
Re: numbers not adding up!
by pbeckingham (Parson) on Aug 07, 2004 at 22:59 UTC | |
by wusphere (Novice) on Aug 07, 2004 at 23:04 UTC | |
by wusphere (Novice) on Aug 07, 2004 at 23:06 UTC | |
by wusphere (Novice) on Aug 07, 2004 at 23:08 UTC | |
by BUU (Prior) on Aug 08, 2004 at 06:22 UTC |