in reply to Best way to read line x from a file
Here is how I read in a specific line from a file if I am only interested in the one bit of a file.
Now, if you're going to potentially bounce around within the file (say, look at line 5000, then line 20, then line 42, etc), there are other strategies, but since I don't think that's what you're looking for, we won't go there right yet. . .$. = 0; do { $LINE = <FILE> } until $. == $DESIRED_LINE_NUMBER || eof;
- - arden.
arden is more of an orangutan than a monkee
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Best way to read line x from a file
by Melly (Chaplain) on Mar 29, 2004 at 15:35 UTC | |
by arden (Curate) on Mar 29, 2004 at 15:55 UTC |