www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/30/14:12:17

Message-ID: <000701bf22f1$27db2800$b21509d2@raider>
From: "Ryan" <ryang AT chariot DOT net DOT au>
To: <djgpp AT delorie DOT com>
Subject: Re: best way to read selected data from a file?
Date: Sun, 31 Oct 1999 01:39:32 +0930
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

wow...that is so clever yet simple in that i cannot beleive i cannot work
stuff like that out...

thanks..




-----Original Message-----
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
Date: Tuesday, 26 October 1999 4:01
Subject: Re: best way to read selected data from a file?


>
>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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019