Date: Tue, 26 Oct 1999 08:31:20 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: best way to read selected data from a file? In-Reply-To: <3813D291.5F1FF7A1@montana.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Ryan wrote: > But what If I want to go straight to line 15 and read that line? Besides the other suggestions, there's one that frequently gets overlooked: read the entire file into memory, then scan the buffer counting \n characters; when you have seen 14 of them, you are at the beginning of line 15. Given the amount of memory available to you in DJGPP, this is much simpler than messing with fseek, fscanf, and the like. More often than not, it will be also faster.