On Mon, Jul 02, 2001 at 10:48:06AM -0400, Pedro A Reche Gallardo wrote:
: Hi all, I have a file that it looks as it follows
:
: 1 0.057 M
: 2 0.819 R
: 3 0.731 V
: 4 0.708 K
: 5 0.070 G
: 6 0.611 I
: 7 0.055 +
: 8 0.748 +
: 9 0.864
Been playing around with this. It should be a start for you. No doubt you
will have questions and others will improve on it...
---
use strict;
my $file = "test.txt";
my ($line_start, $line_end, $letters, %data);
open FILE, "$file" or die "Can't open $file: $!";
while() {
my ($line, $nu
On Jul 2, Pedro A Reche Gallardo said:
>1 0.057 M
>2 0.819 R
>3 0.731 V
>4 0.708 K
>5 0.070 G
>6 0.611 I
>7 0.055 +
>8 0.748 +
>9 0.864 N
>10 0.146a
>11 1.782Q
>12 2.707+
>13 0.893.
>14 1.252
> "Randal" == Randal L Schwartz <[EMAIL PROTECTED]> writes:
Randal> This is the simplest I could come up with in a few minutes. Hope it helps.
Randal> my @stretch;
Randal> while (<>) {
Randal> my ($line, $val, $char) = split;
Randal> if ($val < 1) {
Randal> push
--- "Randal L. Schwartz" <[EMAIL PROTECTED]> wrote:> use
strict;
> my @stretch;
> while (<>) {
> my ($line, $val, $char) = split;
> if ($val < 1) {
> push @stretch, $char;
> }
> if ($val >= 1 or eof()) {
> if (@stretch >= 9) {
> printf
> "Paul" == Paul <[EMAIL PROTECTED]> writes:
Paul> Couldn't
>> if ($val < 1) {
>> push @stretch, $char;
>> }
>> if ($val >= 1 or eof()) {
Paul> be done to the same result with just
>> if ($val < 1) {
>> push @stretch, $char;
>> } elsif (eof()) {
No, because I need to use the results of