in reply to How to read lines between specific character
#!/usr/bin/env perl open F, "</tmp/fff"; $b=$between=$energy=0; while (<F>) { if (/energy/i) { $energy++; $between=$b; } elsif ($energy) {$b++} } print $energy, "/", $between;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to read lines between specific character
by MishaMoose (Scribe) on Nov 12, 2010 at 15:01 UTC | |
by AG87 (Acolyte) on Nov 13, 2010 at 18:45 UTC | |
|
Re^2: How to read lines between specific character
by AG87 (Acolyte) on Nov 13, 2010 at 18:47 UTC | |
|
Re^2: How to read lines between specific character
by AG87 (Acolyte) on Nov 13, 2010 at 18:52 UTC | |
|
Re^2: How to read lines between specific character
by AG87 (Acolyte) on Nov 13, 2010 at 19:09 UTC | |
|
Re^2: How to read lines between specific character
by AG87 (Acolyte) on Nov 13, 2010 at 18:44 UTC |